API Error Handling
When you send a request to the ANZ eGate payment gateway, you receive an HTTP status code as part of the response. This code lets you know whether the gateway has successfully received and processed your request.
The following sections describe the HTTP status codes used by the gateway.
Success: 201 code
The gateway uses the 201 status code for successful requests, where it has received the request, parsed it successfully, and mapped it to a valid API operation.
Client-side error: 4XX codes
The status codes in the 4XX range refer to a problem on the client side, within the request you sent.
The exact code defines the type of the problem. The most common codes are:
- 400 code is used when the request is malformed, and the gateway cannot parse it.
Check the request structure for valid format and all mandatory fields present then resend the request.
- 401 code is used when the authentication for the request fails.
Check the authentication credentials that you are using in the request and resend it.
error.cause
field in the response body is usually set to INVALID_REQUEST. The same value is used both when the request is malformed and if there is a problem with authentication. Always check the HTTP status code to understand the exact reason for the problem.Server-side error: 5XX codes
The status codes in the 5XX range refer to a problem on the gateway side. The most commonly used code is 500, which is used when the gateway encounters an error when processing the request.
If you receive a 5XX code from the gateway, then keep resending your request at reasonable intervals for every first few seconds and then every minute. If the problem persists for an hour or more, contact your support team at ANZ Worldline Payment Solutions or ANZ eGate payment gateway.