GETTING STARTED

Error Handling

Check the HTTP response and the API response body before treating a request as successful. A successful HTTP exchange can still contain an API validation error.

JSON errors are returned in an errors collection. Depending on the endpoint, this can be a list of messages or an object keyed by field name. XML errors appear as one or more error elements inside wmc-response, with the response status set to 0.

Correct validation errors before submitting the request again. If a connection fails or times out after submission, check the payment or file status before retrying to avoid a duplicate submission. SDK exceptions include the API response when one is available.

JSON response

JSONResponse example
{
  "errors": {
    "payee": "You must supply a payee"
  }
}

XML response

XMLResponse example
<wmc-response status="0">
	<error>You must supply a payee</error>
</wmc-response>

Search documentation