cancel
Showing results for 
Search instead for 
Did you mean: 

CIM createCustomerPaymentProfile

I am using CIM - XML - PHP

 

I can create a customerPaymentProfile successfully unil I can any of the following to <billTo>:

address, city, state, zip, country, then I get the error:

 

[E00003] The element 'billTo' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'address' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'faxNumber' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.

 

I don't understand how address, etc are invalid.  The sample code did not use these.  Am I missing something?

 

Thank you

 

 

ed704
Member
1 ACCEPTED SOLUTION

Accepted Solutions

follow the xml documentation sample. sequence matter for the xml.

View solution in original post

RaynorC1emen7
Expert
3 REPLIES 3

follow the xml documentation sample. sequence matter for the xml.

RaynorC1emen7
Expert

We are using the JSON API and facing the same problem. I'm sure that JSON doesn't enforce any order for the elements. 

 

This works

{
  "createCustomerProfileRequest": {
    "merchantAuthentication": {
      "name": "5KP3u95bQpv",
      "transactionKey": "346HZ32z3fP4hTG2"
    },
    "profile": {
      "merchantCustomerId": "432652",
      "description": "Profile description here",
      "email": "customer-profile-email@here.com",
      "paymentProfiles": {
        "customerType": "individual",
        "billTo": {
          "firstName": "John",
          "lastName": "Doe",
          "address": "123 Main St.",
          "city": "Bellevue",
          "state": "WA",
          "zip": "98004",
          "country": "USA",
          "phoneNumber": "000-000-0000"
        },
        "payment": {
          "creditCard": {
            "cardNumber": "4111111111111111",
            "expirationDate": "2020-12"
          }
        }
      }
    },
    "validationMode": "testMode"
  }
}

 

Whereas, this doesn't work.

{
  "createCustomerProfileRequest": {
    "merchantAuthentication": {
      "name": "5KP3u95bQpv",
      "transactionKey": "346HZ32z3fP4hTG2"
    },
    "profile": {
      "merchantCustomerId": "432652",
      "description": "Profile description here",
      "email": "customer-profile-email@here.com",
      "paymentProfiles": {
        "customerType": "individual",
        "payment": {
          "creditCard": {
            "cardNumber": "4111111111111111",
            "expirationDate": "2020-12"
          }
        },
        "billTo": {
          "firstName": "John",
          "lastName": "Doe",
          "address": "123 Main St.",
          "city": "Bellevue",
          "state": "WA",
          "zip": "98004",
          "country": "USA",
          "phoneNumber": "000-000-0000"
        }
      }
    },
    "validationMode": "testMode"
  }
}

Please help.

Hi aneel11986

 

The Authorize.Net JSON is not RESTful and is converted to XML once received, thus the order is defined and requests must be submitted in the defined order documented in the API Reference Guide and schema

 

Regards,

Elaine