Just an example. Your website is www.mywebsite.com and the page where you do a validation is sitting at
www.mywebsite.com/mymatterport.html. You have created a unique ID for your client tour as ZZZZZZZZZ and an actual Matterport model id for this tour is XXXXXXXXX
Your database file should have this one record, It can have a lot of them for other clients tours but this one will be for a specific tour in the example.
ZZZZZZZZZ XXXXXXXXX
So you give your client embed code
<iframe width='853' height='480' src='www.mywebsite.com/mymatterport.html?m=ZZZZZZZZZ' frameborder='0' allowfullscreen allow='xr-spatial-tracking'></iframe>
mymatterport.html page code should read m parameter and it will be ZZZZZZZZZ, then based on your database it matches with model id XXXXXXXXX. That is matterport model ID you need to use.
So your code in mymatterport.html will be calling
https://my.matterport.com/show/?m=XXXXXXXXX after all when you check your database and you put all it returns into a variable. What it is going to be returned is going to be a matterport HTML page with all code and a player to load an actual Matterport tour. If the tour is disabled Matterport will return an HTML page that displays "oops..." message. Since you are saving Matterport response to a specific model ID into a variable you can run JavaScript function on it for strings and see if there is oops message in it. If there is you can write your own HTML page on the fly and return it to client. You can return your own design message, a link to pay, an image or basically anything that can be displayed in HTML.
If you cannot find this string or just "oops" word then the tour is not disabled and you can write back all content stored in your variable. Since with publicly shared tours Matterport will return HTML that contains their own JavaScript code and a Matterport 3D tour player the tour will be displayed.
Actually the same way you can do a lot of things such as
-Collect viewer details before showing a 3D tour
-Make a paywall for a 3d tour.
-Check from where a 3d tour is called and if you do not want it to be shared by others on their websites you can display a message that the tour can only be published by your client on their website and publishing it on "this" website is not allowed.
-disable an access to a tour for specific IPs, countries and regions.
-at least get IP addresses of viewers who wants to view a tour.