v1

Errors

Errors and Troubleshooting

MyPay API uses standard HTTP status codes to indicate the success or failure of requests.

Status Codes

Code Meaning Description
200 OK The operation was successful
400 Bad Request The request data is invalid (check the error message)
401 Unauthorized Valid API key is missing or expired
403 Forbidden Access denied (token might be invalid)
404 Not Found Resource not found (e.g. wrong transaction ID)
500 Server Error An internal server error occurred

Error Message Structure

In case of an error, you will receive a JSON response containing details of the problem:

{
    "message": {
        "code": 400,
        "error": ["Invalid client ID"]
    },
    "data": {},
    "type": "error"
}

Common Errors and Solutions

Error Cause Solution
Invalid client ID or Invalid client secret Credentials are incorrect Copy Client ID and Secret accurately from the dashboard, and use the matching Base URL (Sandbox vs Production)
Request token is expired Access token expired (valid for 10 minutes) Request a new token with POST /authentication/token
Access denied! Token not found Token missing or malformed in the header Send Authorization: Bearer <token>