Facts
Parties and instances: The appellant is a Nigerian national (born 1977). In 2016 he married in Zurich a Cameroonian national residing in Switzerland with a right of residence, and on 14 October 2016 he applied for a residence permit on the basis of the marriage. The respondents are the Migration Office and the Security Directorate of the Canton of Zurich. The appellant is represented by a lawyer.
Procedural history: The Migration Office rejected the application on 2 November 2016. The Security Directorate dismissed the appeal (Rekurs) on 30 January 2017. On 27 February 2017 the appellant lodged an appeal with the Administrative Court of the Canton of Zurich. Its application for legal aid and legal representation was rejected on 2 March 2017. At the same time, an advance on costs of CHF 2'060.-- was requested, with a time limit of 20 days and a warning of non-entry. The payment deadline expired on 27 March 2017.
Subject matter of the dispute: By order of the single judge of 9 May 2017, the Administrative Court did not enter into the appeal and imposed court costs of CHF 1'100.--. Reasoning: the advance on costs had been paid only on 29 March 2017 and therefore late.
Requests before the Federal Supreme Court: The appellant requests that the order of 9 May 2017 be set aside and the matter be remitted for substantive consideration, and that legal aid be granted for the federal proceedings. The Administrative Court requests that the appeal be upheld. The Security Directorate waived a response, and the Migration Office did not submit a response. Suspensive effect was granted.
Evidence: The appeal was accompanied by a postal receipt showing that the advance on costs was paid at the Selnau post office on 27 March 2017. In the federal proceedings the Administrative Court acknowledged its error.
Considerations
Admissibility (consid. 2.1): The appeal concerns a matter under public law (Art. 82 lit. a FSCA). In foreigners' law, the appeal in public law matters is inadmissible against permits to which neither federal nor international law confers an entitlement (Art. 83 lit. c no. 2 FSCA). Under Art. 44 AuG there is no entitlement in the case of marriage to a foreign national with a right of residence. An entitlement could arise from Art. 13 Cst. and Art. 8 ECHR, which could not, however, be conclusively assessed on the basis of the facts.
Subsidiary constitutional complaint: The question of admissibility could be left open, since the submission would have to be treated as a subsidiary constitutional complaint. The appellant took part in the proceedings before the lower court and has a claim under Art. 29 para. 1 Cst. to the consideration of his appeal (Art. 115 FSCA). The 30-day time limit was observed. The application of cantonal procedural law is challenged, which is reviewed only from the perspective of a violation of the constitution (Art. 95 lit. a-c, Art. 116 FSCA).
Timeliness of payment (consid. 2.2): The payment deadline for the advance on costs under § 70 in conjunction with § 11 para. 2 VRG/ZH and § 71 VRG in conjunction with Art. 143 para. 3 CPC is met if the amount is handed over to the post or debited from a postal or bank account in Switzerland no later than the last day of the time limit. The postal receipt of 27…