This reply is copied from a different thread regarding cross-border flights without landing:
You need to be on an active VFR or IFR flight plan when the flight crosses the border.
Unless you land outside of the US, there is no Customs notification requirement by eAPIS or phone.
ADIZ rules apply on the southern border, but there is no ADIZ on the US/Canada border. So no DVFR flight plan needed there.
See AIM 5-6-5
Civil Aircraft Operations To or From U.S. Territorial Airspace
- Civil aircraft, except as described in subparagraph 5-6-5b below, are authorized to operate to or from U.S. territorial airspace if in compliance with all of the following conditions:
- File and are on an active flight plan (IFR, VFR, or DVFR);
- Are equipped with an operational transponder with altitude reporting capability, and continuously squawk an ATC assigned transponder code;
- Maintain two-way radio communications with ATC;
- Comply with all other applicable ADIZ requirements described in paragraph 5-6-4 and any other national security requirements in paragraph 5-6-2;
- Comply with all applicable U.S. Customs and Border Protection (CBP) requirements, including Advance Passenger Information System (APIS) requirements (see subparagraph 5-6-5c below for CBP APIS information), in accordance with 19 CFR Part 122, Air Commerce Regulations; ... etc
Note that the phrase "ATC assigned transponder code" above does not mean a discrete code, An interpretation from over a decade ago states that 1200 is the ATC assigned code for VFR flights. To answer your specific questions. US FSS can issue a discrete code for you for a border crossing, but this would not be valid in Canadian airspace. Unless there is a temporary rule of which I am not aware, you are not required to be in contact with Canadian ATC except in areas where controlled VFR applies. You are not required to be receiving radar service from ATC to cross the border. In fact for much of the northern border, you will not be visible to Centers at sightseeing altitudes. Contacting FSS before crossing and advising you will maintain a listening watch can meet this requirement. As always, the NOTAM to monitor 121.5 applies.
So what happens if you need to land unexpectedly and have not complied with the rules?
An emergency allows for deviation from any of these rules to the extent necessary.
Jon