Reply
Member
Posts: 2
Registered: ‎08-12-2019

The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:transactionKey' element is invalid

Hi

 

End point: https://apitest.authorize.net/xml/v1/request.api

 

getting the below error :

 

{

"messages": {
"resultCode": "Error"
"message": 
  {
"code": "E00003"
"text": "The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:transactionKey' element is invalid - The value XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX is invalid according to its datatype 'String' - The actual length is greater than the MaxLength value."
}
 
 
}
 

}

 

 

Request JSON:

 

{
"getHostedPaymentPageRequest": {
"merchantAuthentication": {
"name": "5adLKb29H",
"transactionKey": "my key"
},
"transactionRequest": {
"transactionType": "authCaptureTransaction",
"amount": "20.00",
"profile": {
"customerProfileId": "123456789"
},
"customer": {
"email": "ellen@mail.com"
},
"billTo": {
"firstName": "Ellen",
"lastName": "Johnson",
"company": "Souveniropolis",
"address": "14 Main Street",
"city": "Pecan Springs",
"state": "TX",
"zip": "44628",
"country": "USA"
}
},
"hostedPaymentSettings": {
"setting": [
{
"settingName": "hostedPaymentReturnOptions",
"settingValue": "{\"showReceipt\": true, \"url\": \"https://mysite.com/receipt\", \"urlText\": \"Continue\", \"cancelUrl\": \"https://mysite.com/cancel\", \"cancelUrlText\": \"Cancel\"}"
},
{
"settingName": "hostedPaymentButtonOptions",
"settingValue": "{\"text\": \"Pay\"}"
},
{
"settingName": "hostedPaymentStyleOptions",
"settingValue": "{\"bgColor\": \"blue\"}"
},
{
"settingName": "hostedPaymentPaymentOptions",
"settingValue": "{\"cardCodeRequired\": false, \"showCreditCard\": true, \"showBankAccount\": true}"
},
{
"settingName": "hostedPaymentSecurityOptions",
"settingValue": "{\"captcha\": false}"
},
{
"settingName": "hostedPaymentShippingAddressOptions",
"settingValue": "{\"show\": false, \"required\": false}"
},
{
"settingName": "hostedPaymentBillingAddressOptions",
"settingValue": "{\"show\": true, \"required\": false}"
},
{
"settingName": "hostedPaymentCustomerOptions",
"settingValue": "{\"showEmail\": false, \"requiredEmail\": false, \"addPaymentProfile\": true}"
},
{
"settingName": "hostedPaymentOrderOptions",
"settingValue": "{\"show\": true, \"merchantName\": \"G and S Questions Inc.\"}"
},
{
"settingName": "hostedPaymentIFrameCommunicatorUrl",
"settingValue": "{\"url\": \"https://mysite.com/special\"}"
}
]
}
}
}

 

 

can somebody please help me I am putting correct key

Highlighted
All Star
Posts: 685
Registered: ‎11-05-2018

Re: The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:transactionKey' element is invalid

@ajit

You are not. The trans key is never that long. You have over 50 characters there. go to API credentials and generate a new transaction key.