Understand how Fapshi API handles successful and failed requests, including response codes and formatting guidelines.
When interacting with the Fapshi Payment API, it’s important to understand how the system responds to different types of requests. This helps in properly handling errors and managing successful transactions within your application.
Any successful request made to the API will return an HTTP status code of 200
, indicating that the operation was processed correctly.
The content of the response body will vary depending on the endpoint you called, but you can always expect structured data in a JSON format.
Example response for a successful request:
If something goes wrong, Fapshi will return a 4XX HTTP error code, depending on the nature of the issue:
The body of the response will always contain a message
field that gives a clear explanation of the failure reason.
Example error response:
Make sure to always read the message
field of the response to determine the reason for failure and guide your debugging process.
To avoid unexpected failures, keep in mind the following formatting rules:
You can find SDK implementations of all API endpoints in different programming languages in our GitHub SDK repository.
Need help? Contact us at support@fapshi.com or visit our Help & Support Center.