# UnionID Mechanism Dxplaination
If the developer has multiple Mobile App, Website App,A user's uniqueness can be distinguished by UnionID from a public account (including Weixin Mini Program), since the user's UnionID is unique as long as mobile apps, website apps, and public accounts (including Mini Programs) under the same WeChat open platform account.In other words, the same user, for different applications under the same WeChat open platform, the UnionID is the same.
# UnionID Access
The Weixin Mini Program is bound to the developer account, and you can get the UnionID through the following ways.
Developers can directly through wx.login +
code2SessionGet the user UnionID without user authorization.Weixin Mini Program The UnionID can be obtained from the cloud function via Cloud.getWXContext .
Once a user has made a payment in Weixin Mini Program (not currently supporting MiniGame), the developer can obtain the user's UnionID directly through the
getPaidUnionIdinterface, without user authorization.Note: This interface is only valid for 5 minutes after the user's payment is completed, so please the developer handle it properly.
# WeChat Open Platform Binding Weixin Mini Program Process
Login WeChat Open Platform - Management Center - Weixin Mini Program - Binding Mini Program
