Getting error 500 on a InvoiceSend api call

Hi,
I am testing the API and I am getting an error 500 when trying to send an invoice.
The request is so simple that I cannot find any issues on my part, and I am using the same configuration that creates the invoice perfectly.

The error is

[500] Something wrong. Please try again.


Can you have a look?
Thanks

I think the problem is the integration with make.com (integromat)
There, it is supposed to add the authorization, but it does not work with API calls, which is an option.

This, and the missing “invoice send” integration with them, makes it impossible to use for real automation. :frowning:

Hi @expertoswp

This was an integration built by make.com. The error you’ve pasted doesn’t look like one that’s generated on our end, so it may be worth reaching out to Make directly to see if they can offer any assistance.

Sorry we can’t help on this occasion.

I have opened a ticket with them. I hope they can fix it.
But it is using your brand and damaging it, because your customers (me) try to use at it does not work.
so maybe you can help them…?

Ah, also the error IS generated in your end, when the format is not correct you get that error 500.

This error that you pasted isn’t one generated by us. It could very well be that the JSON is formatted incorrectly and we’re returning an error to Make. But without the error message we’re returning, it’s a bit tricky to diagnose it.

Are you seeing an error when trying this call directly?

You are returning that.
That happens when you send the headers as headers and the body as body.
I am not going to build the whole thing wrong again but you just create a post request to invoice send.
Add headers as headers to the request, not including them into the body.
Add the body only including the body:

{
"SendItem": {
"InvoiceID": "19282",
"SendByEmail": "false",
"SendBySnailMail": "false"
}
}

And then launch that.
It will return the error 500 with a null response from your server.
I agree is a bit trick to diagnose, I have not find any information and docs about api responses…

Have you tested your api call in the Quickflle Sandbox?
Do you get the same error?

The sandbox do not send the headers with the info as I am reporting so you will never see that error there.

Sorry. What are you talking about?

The payload header is sent in the sandbox and is part of the request. The payload has two parts the header and the body. The payload header is not the http header.

If you are talking about the http header then POST and Content-Type is XML or JSON.

This is all in the QuickFile document (api.quickfile.co.uk)

I tried to explained above. It is not easy to explain. Yes a header is normally part of the http header.
Not in Quickfile, where is part of the “body”

Imho, it is poorly documented, because the use of the word “header” not referring to the real header, but to the body with a header section.
I am repeating myself here. This was about the error 500. I am explaining how to get it. No more extra information unless you try and let me know.

The payload has a header that is nothing to do with the HTTP header. The payload header is just a word it could be called anything.

What programming language are you using?

Please post here you’re full code and i will help you get it working.

I really appreciate the help, but this post is not me asking for help.
It is a bug report that I found when I was trying to make this work.
If this has happened to me, it can happens to others, so I think is worth it to fix.
But it is not my decision, I just can provide the error I got and the way to repeat it.
Apart from that I already got this working.
Thanks

It’s not a bug in QuickFile, it’s a mis-understanding of terminology. Having “header” and “body” sections within a request payload is a long established pattern going right back to SOAP web services, or any similar API technology where the content of the message is independent of the protocol used to transmit that message. Other APIs might call that section “metadata” or similar instead of “header”.

Lets agree to disagree. Return a “500” is the bug.
If the request is malformed, it should reply with that.
A 500 is not a proper reply for a malformed request.
A 400 is a much better response.

1 Like

I cannot reproduce you’re error.
If I miss format the payload I get an error explaining so.

Please explain all the steps and the programming language you are using to receive this 500 response.

Also please include the full code so I can test.

If you are using a third-party service to integrate with quickfile, this is more likely the third party service is miss formatting the request.

1 Like

Hi @expertoswp

If you could provide some sample code, that would be a great help to try and replicate this issue.

As I mentioned in another thread, the errors are returned as text with a description of what went wrong. They wouldn’t usually come in the format you’ve pasted in the first message, which suggests it may be an error on “make.com”.

If you log any API calls for debugging purposes that have caused that error, you’re welcome to send both the request and the response to us privately to investigate further.

The reason I asked about coding language above (which may be the same reason other users also asked), is that I am aware of an unofficial PHP library which may help with the development.

It is explained above how to reproduce the error 500. I am not replying again on this thread.
Thanks