1

I'd like to thank anyone for their response a head of time.

I'm getting the below error when calling a AVALARA API from a Java application.

{"ResultCode": "Error","Messages": [{"Summary": "Malformed JSON near 'ProcessCode' : [Field \"ProcessCode\" is not recognized]","Severity": "Error","Source": "Avalara.Web.REST"}]}  

Passing the below. ProcessCode is a required field for this API. I feel like I must be missing something simple. I'm not a Java expert, nor an expert with JSON, so I'm kind of lost at this point. Any ideas?

[
    {
        "ProcessCode" : "1", 
        "DocCode" : "1234", 
        "DocType" : "1", 
        "DocDate" : "09/05/2013",
        "CustomerCode" : "11111111",
        "LineNo" : "1",
        "Amount" : "100",
        "DestRegion" : "US",
        "DestPostalCode" : "12345",
        "OrigRegion" : "US",
        "OrigPostalCode" :"12345"
    }
]  
Nidhish Krishnan
  • 20,593
  • 6
  • 63
  • 76
Jim Main
  • 11
  • 1
  • Which specific API are you invoking (what's the URL)? – Lawrence Dol Sep 05 '13 at 23:42
  • I don't know anything about avalara but I notice you are passing all of the values as strings. perhaps ProcessCode should be a numeric type (i.e. `"ProcessCode":1,`). My other guess would be that "1" is not a valid process code and you need a different value in there. – digitaljoel Sep 05 '13 at 23:56
  • The message kinda makes it sound like "ProcessCode" itself isn't valid. – Hot Licks Sep 06 '13 at 00:59

1 Answers1

0

You're passing a JSON array (square brackets), try sending just a single JSON object (no square brackets)

Chris Gerken
  • 16,221
  • 6
  • 44
  • 59