Skip to main content

Debug your integration

If you are struggling while trying to use our APIs using one of our SDKs or your custom code here you can find simple steps to successfully resolve the issues you are experiencing.

Try first

It is always suggested to try using the API reference or Postman before trying to use the API, to be faster while implementing the needed methods with custom code or SDKs.

❌  Permission errors​

If you are getting 401 Unauthorized or 403 Forbidden http status codes there are a few things you have to check:

  • 401 Unauthorized: This error is returned when there is some problem with the Access Token (it could be missing or invalid) or with the Company Id (it could be invalid, or the Access Token could have been issued for a different company). Be sure to set up the token correctly, and check if the Company Id is valid using our List User Companies method.

  • 403 Forbidden: It means that you are trying to access some resource without having the proper permissions, most probably because your token is missing the correct scopes for the action you're trying to perform.

📝  Print the request JSON​

The most common issues the developers report to us are related to POST and PUT requests, and usually are due to errors while composing the request body.

First, be sure to provide your payload correctly to the API invocation: we had many cases of customers sending us an empty request because they didn't pass the parameter correctly in their code.

Then, check the request validity: since the body structure can be really big and complicated, it is really easy to put a parameter in the wrong position while composing the payload by hand; using the models included in our SDKs should prevent this kind of issue.

If you still want to avoid our SDKs, then we suggest you use at least a JSON Marshaller: this will help you to generate valid JSON strings. If you are brave enough to compose your JSON by hand, then we suggest you at least check the body validity using a JSON Validator: you could have missed a comma somewhere.

Next, you should check if the structure of the body reflects the Schema published in our API reference. If you're experiencing this kind of issue while using our SDKs, you can check the generated JSON by printing it as explained in the Use raw JSON as request body​ section included on every SDK introduction page. If you want to be sure that your JSON is valid, you can always try to send a request using our API Reference: if you obtain a valid response then your JSON is 100% valid.

✅  Check the documentation​

Here in our Developers Hub, you can find several complete examples for many languages and API methods, most notably in the create an invoice. If you can't find what you need, we provide a Search Box to help you with the research. If you are using one of our SDKs, then you can also check the GitHub repository of the SDK: in the README you can find the description of every available method implemented in our libraries. Additionally, you can check the Test files to check some examples of the SDK usage.

💣  Nuclear option​

If at this point you're still facing the same issue, then we suggest you contact us. The problem could be related to your environment, or there could be an actual bug in our SDKs or APIs, so it requires further investigation.