I am using python rest web service and trying to a...
# suitetalkapi
s
I am using python rest web service and trying to add a record in journal entry and getting this error.
Copy code
Bad Request","status":400,"o:errorDetails":[{"detail":"Invalid value for the resource or sub-resource field 'line'. Provide a valid value.","o:errorPath":"line","o:errorCode":"INVALID_VALUE"}]}
What does this mean - Invalid value for the resource or sub-resource field 'line' Here is what I am passing -
Copy code
body=json.dumps({
   "externalid":"sree",
   "subsidiary":{"id":"1"},
   "memo":"sree testing",
   "transdate":"2022-08-17",
   "tranid":"sree",
   "line":{"count":1,
         "items":{
            "account":"sree",
            "credit":200}
         }
})
b
use the metadata to tell what your request body should look like
bonus points if you use a library to validate your request for you, or if you generate a client from the metadata
alternatively make the journal entry in the ui first, then get it afterwards so you know what the request should look like
s
thank you.I will try your suggestions.
Thank you @battk. I was able to successfully create few Journal Entries using python - Rest Web service. Thank you for your help.