apiresponse
API Response
The system exposes all external interfaces in a standard RESTful format. Responses are divided into two categories: success responses and error responses.
HTTP Status Codes
Success Response
For successful requests, MidasPay returns a 2XX HTTP status code. The response body conforms to the specific API contract.
Error Response
If the system returns an error response (e.g., order creation failure), the response structure is handled uniformly:
- A
non-200HTTP status code is returned. - A
4xxstatus code indicates an invalid request — the merchant should review and correct the request parameters based on the error response. - A
5xxstatus code indicates a server-side internal error — the error code should be forwarded to the server-side development team for resolution. - A unified error code format is used — each business error returns a distinct error code along with a detailed error description and a link to the help documentation.
- A
debug_idis always included, which allows the merchant to reference when contacting us to retrieve error logs.
Example:
{
"name": "ERROR_NAME",
"message": "Error message.",
"debug_id": "debug_id",
"details": [
{
"@type": "type.apis.com/rpc.BadRequest.FieldViolation",
"field": "field_name",
"value": "value_passed",
"description": "Error description."
}
],
"links": [
{
"url": "https://error_documentation_link",
"description": "Describes what the link offers."
}
]
}