The CreatePayer API call takes a UK domestic sortcode and account number but will not modulus check the supplied details on its own.
If you wish to apply modulus checking to the creation of direct debit payers we would recommend that the process be broken into two sections.
A service such as Validate can be used to provide seamless modulus checking of sortcode and account numbers. See this page for more information:
https://validate.paygate.cloud/validateonlineapi/swagger/ui/index