Q:

JSON Serialize API that can return string or int

I'm building an application for someone, but because of some bad choices in the start the API now returns errorcodes in string OR in integer format.  In the past I was albe to simple map the objects to the API, but because if this I can't any more.  Now I have no idea how to solve this without breaking the code that's dependent on this model. 
The model:
public class JsonPayloadResponse<T>
{
    public bool success { get; set; }
    public int error { get; set; }
    public T data { get; set; }
}

The old parsing way:
 private T ConvertJsonToObject<T>(string payload)
        {
            try
            {
                return JsonConvert. DeserializeObject<T>(payload);
            }
            catch
            {
                return default(T);
            }
        }

What is the best and clean way to solve this? 

A:

Have a property of type dynamic.  Json.net correctly deserializes that property based on the actual value.