With your link, you can customise a couple of details to ensure that the flow is best suited to your needs
- Provide an existing wallet for the user on your app
- Create one-time purchase links
If your app already has a wallet for your users, you can provide the user's wallet address via a query parameter. The buyer will be taken directly to choose their payment method.
Remember to URI encode your query parameters!
const url = new URL(PAPER_CHECKOUT_LINK); // Required // Show your dApp's name on the wallet to clarify to // the buyer this wallet is provided by your dApp. url.searchPrams.append('app_name', 'YOUR_APP_NAME_HERE'); // Required. // The buyer cannot change the wallet where their purchase will be delivered. // // The buyer will be able to native mint to this wallet by connecting // this same wallet address in the checkout flow. // They'll also be able to pay with crypto with another wallet. url.searchParams.append('wallet', 'USER_WALLET_HERE'); // Optional // If an email address is provided, Paper will automatically email them when their purchase is completed. url.searchParams.append('username', 'USERNAME_HERE'); console.log(url.href); // The final url
Refer to the API documentation for more info.
If you're looking for granular control of who can make purchases from your checkout, consider creating unique links that each only allow one purchase. Your checkout won't be publicly accessible, and buyers without a One-Time Purchase link will be redirected to your landing page.
When creating a link, you can lock certain fields like walletAddress and email to ensure your purchase is made by the right buyer
The link can be opened multiple times if the purchase is not completed. For instance, a buyer can start a purchase but decide to complete it from another device. If they shared this link with a friend, the friend would be able to complete the purchase on behalf of the original recipient.
But the link can only be used to make a purchase once. After the purchase is completed, the unique link redirects to the “Your purchase is completed!” page.
By allowing you to gate purchases, you can support the following behaviors (some may require disabling native mints):
- Use your own off-chain data for presale and allowlists
- Ensure a buyer can only make a certain number of purchases
Hooray! You have a checkout ready to go! Tweet it, snap it, go share your checkout with the world!
We can now look into listening and triggering customer work whenever a purchase is made. Let's read into how we can extend the Paper checkout!