API Changes - Postcode Validation Change

Dear developers,

We are adding a new validation rule for ‘address_postcode’: the postcode must start with an alphanumeric character. This will happen the week starting the 24th of August 2020.

The full set of validation rules for ‘address_postcode’ will be:
Postcode is optional and can be left blank
Alphanumeric characters, hyphens, and spaces are allowed
Must not be more than 20 characters long
Must start with an alphanumeric character

To include these rules in your code, you may use the following regular expression:
^([A-Za-z0-9][A-Za-z0-9\s-]{0,20})?$

Example

API call

{
  "new_account_maltainvest": 1,
  "address_postcode": "-1234",
  ...
}

Response

{
  "echo_req": {
    "new_account_maltainvest": 1,
    "address_postcode": "-1234",
    ...
  },
  "msg_type": "new_account_maltainvest",
  "error": {
    "code": "InputValidationFailed",
    "details": {
      "address_postcode": "String does not match '^([A-Za-z0-9][A-Za-z0-9\s-]{0,20})?$'"
      },
      "message": "Input validation failed: address_postcode"
    },
  }
 }

Please make the necessary changes to your code.

Thank you.

Team Deriv.com
[email protected]

Sign In or Register to comment.