Integration and Testing

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

Reply
Member
Posts: 8
Registered: ‎03-30-2018

Unable to create new customer via .NET SDK when supplying metchantCustomerID, email, AND description

When creating a new customer profile, I'm supplying the merchantCustomerId, the email, and the description. I provide no additional information (address, payment information , etc). Calling controller.Execute results in the following controller error message:

 

"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: 'paymentProfiles, shipToList' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'."

 

If I don't provide a merchantCustomerId value, then the controller.Execute runs successfully and I'm able to obtain a response from the controller's GetApiResponse().

 

Is it possible to create a new customer profile providing all three pieces of information? Or must I create the account first, then update the account with the merchantCustomerId value?

 

LoadCredentials();

customerProfileType customerProfile = new customerProfileType();
customerProfile.merchantCustomerId = subscriber.subscriber_id.ToWebId().Substring(2);
customerProfile.email = subscriber.email;
customerProfile.description = subscriber.subscr_subdomain;

var request = new createCustomerProfileRequest { profile = customerProfile, validationMode = validationModeEnum.none };

// instantiate the controller that will call the service
var controller = new createCustomerProfileController(request);
controller.Execute();
Authorize.Net Expert
Posts: 27
Registered: ‎11-22-2017

Re: Unable to create new customer via .NET SDK when supplying metchantCustomerID, email, AND descrip

Hi jkshay,

Yes, you need to have an account and you need to pass authentication credentials as part of request. Authentication credentials include following two things:

apiloginid and transactionkey

Member
Posts: 8
Registered: ‎03-30-2018

Re: Unable to create new customer via .NET SDK when supplying metchantCustomerID, email, AND descrip

Forgive me, but I *am* passing those pieces of information in. I just failed to post that bit of code:

 

private merchantAuthenticationType LoadCredentials()
        {
            var api_id = WebConfigurationManager.AppSettings["AuthorizeNetAPIID"];
            var api_transaction_key = WebConfigurationManager.AppSettings["AuthorizeNetTransactionKey"];

            var authentication_type = new merchantAuthenticationType()
            {
                name = api_id,
                ItemElementName = ItemChoiceType.transactionKey,
                Item = api_transaction_key
            };

            ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = authentication_type;

            return authentication_type;
        }

Otherwise, I have an account. Most things are working properly for me - I'm able to query existing customers and get their payment profiles, etc. I'm just unable to create a new customer (having the same issue if I try to create a customer from a transaction) if I supply all three pieces of information referenced in my original post.

Posts: 333
Kudos: 73
Solutions: 36
Registered: ‎03-13-2017

Re: Unable to create new customer via .NET SDK when supplying metchantCustomerID, email, AND descrip

Hi @jkshay

 

I was able to create a customer profile with below request 

 

<createCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>78BZ5Xprry</name>
<transactionKey>8s2F95Q7brhHd7Tn</transactionKey>
</merchantAuthentication>
<profile>
<merchantCustomerId>Merchant_Customer_ID</merchantCustomerId>
<description>Profile description here</description>
<email>sscustomer-profile-email@here.com</email>

</profile>
</createCustomerProfileRequest>

 

 

You can use our Try it tab to test these request directly on sandbox 

 

https://developer.authorize.net/api/reference/index.html#customer-profiles-create-customer-profile

 

 





Send feedback at developer_feedback@authorize.net
Member
Posts: 8
Registered: ‎03-30-2018

Re: Unable to create new customer via .NET SDK when supplying metchantCustomerID, email, AND descrip

I don't doubt that it works via the "Try it" tab. I'm attempting to do this via the .NET SDK, as referenced in my post subject and original code sample.

 

Is it possible to view the XML that is generated by the .NET SDK? I suspect maybe the XML isn't generating the nodes in the proper order.