When making API calls to the MassPay service, you may encounter error messages in the response indicating that something has gone wrong. These error messages are accompanied by HTTP status codes that indicate the type of error that has occurred. Here's what each of these status codes means and what you should do if you encounter them:
| Status code | Error title | Error description | What should I do? |
|---|---|---|---|
| 400 | Bad Request | The request you made to the API was malformed or invalid. This could be due to missing required parameters, parameters that were not formatted correctly, or invalid data in the parameters. | Check your request and ensure that all required parameters are included and that they are formatted correctly. |
| 401 | Unauthorized | The request lacked valid authentication credentials. The server requires authentication, but the credentials provided were missing, incomplete, or incorrect. | Check your authentication credentials and ensure that they are correct, up to date, and properly formatted. |
| 403 | Forbidden | The request was valid and your credentials were recognized, but you do not have permission to access the requested resource. | Verify that your account has the necessary permissions or privileges for the requested resource. |
| 404 | Not Found | The resource you requested could not be found. This could be due to an incorrect URL or a resource that no longer exists. | Check the URL and ensure that it is correct. |
| 405 | Method Not Allowed | The HTTP method you used in your request is not supported for the requested resource. | Check the HTTP method used in your request and ensure that it is supported for the requested resource. |
| 429 | Too Many Requests | You have sent too many requests in a given period of time and have been rate limited. | Reduce your request rate and retry using exponential backoff with jitter. Do not retry immediately or at a fixed interval, as this can prolong the throttling. A Retry-After header is not guaranteed on these responses, so your client should not depend on one being present. |
| 500 | Internal Server Error | The server encountered an unexpected condition while processing the request. It was unable to complete the request because of an internal error or malfunction. | Retry the request after a short interval. If the error persists, contact our support team. |
| 504 | Gateway Timeout | The server processing your request did not receive a timely response from an upstream server it needed to complete the request. | Try your request again later. |
In general, when you encounter error messages in MassPay API calls, carefully review the error message and its associated status code to determine the cause. From there, you can take the appropriate steps to resolve the issue, which may include checking your request or reviewing the documentation.
If you run into any problem, you can contact us at [email protected]. We are here to help you!
