Suddenly getting internal server error on all create invoice requests

No worries @crhhe3, good to see others reporting the issue.

@Bryan-Square Please specify the exact change you are suggesting! If accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 suddenly no longer works, what are you suggesting? accept: */*?

Was this a change to the Square API that broke all SF integrations, or do you mean that only recent requests have come in with accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2?

You’ll want to use accept: */* to make the API call. This isn’t something that Square controls since it’s set prior to making the API request. This is something that the integration you’re using sets. It’s probably worth while to reach out and let them know that the client your using is setting an invalid mime type. :slightly_smiling_face:

I will try this - to clarify, you are saying that Salesforce was by default using the correct mime type the past year that this was working fine, and just recently started sending one that is invalid on all callouts that it makes? That would be quite an issue for many thousands of companies. What is “invalid” about accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2?

Since that’s something that they set when making a requests to Square that would be something that they would need to investigate on their end since they have access to the code that sets the mime. The issue on the Square side was that we didn’t return the correct error message to fix the issue and the team is working on improving the error. :slightly_smiling_face:

Setting request.setHeader('Accept', '*/*') did seem to resolve the error, though our requests to the Customer API and Items API do not include this, and they still work fine. What was “invalid” about accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2?

What was “invalid” about accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2? Why does it work for the Customer API and Items API?

This issue has to do with the tech stacks that the APIs are built on which is why you’re seeing it succeed with the Customers API and not the Invoices. Our recommended accept header for API calls is */*. :slightly_smiling_face:

Ok, looks like the change was with Square rather than Salesforce then - better get that into the documentation!

I am having a similar error: System.CalloutException: Unable to tunnel through proxy. Proxy returns “HTTP/1.1 500 Internal Server Error”

The call to the WS is from CRM Salesforce(Sandbox) to Middelware. The strange thing is from a CRM Salesforce (DEV) if it is allowing me

The team is aware of this and working on a fix. :slightly_smiling_face: