Post-expenses API returning "RequiredFieldError" for optional fields

Hey guys!

I’m trying to create expenses using the API but I’m having some issues with what the docs are saying and what the actual API is accepting.

Screenshot of what the docs are saying about the post-body

Screenshot of my post request

As we can see the optional fields are required in the request. I’ve already tried to pass null and empty objects. But I keep getting errors with the API requiring me to continue to pass the entire object

am I missing something here?

thanks!

Hey @willjosefi,

Each of those properties should be listed as required. Thanks for pointing out the error! I will go ahead and get a ticket submitted to fix the documentation.

Actually, if you scroll up a bit you will see that they are listed as required in the more extensive documentation about the model. Thanks again for pointing out the issue.

C# lib docs are wrong too

That makes sense both the API docs and C# docs are generated using the same information so chances are if there is an issue with one there will be an issue with the other. I have found the issue and submitted a PR to fix it. I’ll be sure to do the same for the C# client as well. Thanks again @willjosefi.

glad to help!

is there any chance that this become optional?
I mean… for my use case it makes total sense to not provide all the possible expenses as we are going to work with the Fixed only