Skip to main content

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:

  1. A non-200 HTTP status code is returned.
  2. A 4xx status code indicates an invalid request — the merchant should review and correct the request parameters based on the error response.
  3. A 5xx status code indicates a server-side internal error — the error code should be forwarded to the server-side development team for resolution.
  4. 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.
  5. A debug_id is 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."
}
]
}

Error Codes List