Tweed Docs
  • Welcome to Tweed
    • What Can Tweed Do?
  • Getting Started
    • Embedded Wallets | WaaS
    • Token Checkout | Payments
      • Flow of Funds: Purchase to Settlement
      • Token Checkout
      • Legacy Token Checkout
        • Basic Checkout Integration
        • Checkout + WaaS + Auth
        • Features
          • Payment links
          • Whitelist
          • Flow of Funds
          • Apple & Google Pay
          • AML & KYC Policy Overview
  • Developer Tools
    • Tweed SDKs
      • core-react
        • useAuth
        • useWallet
        • useTweed
        • usePayments
        • useWeb3
      • core-js
      • core-vue
      • Payments SDKs (v1)
        • Frontend SDKs (Payments)
        • Backend SDK (Payments)
        • How to set up your smart contract for Tweed
        • Tezos chain considerations
    • Management Dashboard
      • Create platform
      • Create application
        • UI Customization
    • Webhooks
      • Checkout Webhooks
    • API
      • API (V1)
      • API (V2)
        • Authorization
        • API reference
          • Contracts
            • Add
            • Add contract function
            • Contract
          • Payouts
            • Add
            • Payout
          • Items
            • Add
            • All
              • Contract
                • Count
              • Payout
                • Count
          • Assets
            • Blockchain
            • All
              • Blockchains
          • Blockchains
            • Multiple
            • Native asset
          • Audit event mappings
          • Platform webhooks
            • Set active
          • Tickets
        • Specification
    • External Integrations
      • Wagmi connector
      • Onramp to Crypto
    • Example Projects
    • Supported Blockchains
    • Pricing
  • Products
    • WaaS
    • Payments
Powered by GitBook
On this page
  • Redirect URI
  • Example
  1. Getting Started
  2. Token Checkout | Payments
  3. Legacy Token Checkout
  4. Features

Payment links

create a payment links or use token checkout without using a frontend

Provides a URL to a widget enabling users to purchase an NFT using traditional payment methods such as payment cards, Google Pay, or Apple Pay. This URL can be utilized to send a purchase link to your user's email, for instance.

The widget remains active indefinitely until it is first opened, after which it remains accessible for 24 hours. Once this period elapses, the widget becomes unusable.

Retrun type

Promise<{ widgetUrl: string; requestId: string }>

Redirect URI

Provides the option to redirect users upon completing the checkout process, whether it is successful or unsuccessful.

isTopWindow ensures widget Redirects is top-level window.

redirectUriOnSuccess string

Description: When the widget is closed after a succeeded transaction the widget will redirect to the supplied URL

Called with the transaction hash in the txHash URL param

redirectUriOnFail string

Description: When the widget is closed after a failed transaction the widget will redirect to the supplied URL

Called with the reason to the failure in the error URL param

Example

  const buyNftPayload: NftPurchaseBackendPayload = {
    nftId: "123", //Can be a ramdom generated by the user
    priceInCents: 100, //Optionally 0 for freemint 
    //priceInCrypto: 10000000000000, //If the user wants to get crypto instead of fiat
    fiatCurrencyId: 'USD',
    tokenUri: '<THUMBNAIL_URI>',
    contractAddress: '<NFT_ADDRESS>',
    chain: 'ethereumSepolia', //The chainId according to the Tweed docs
    title: '<NFT_NAME>',
    description: '<NFT_DESCRIPTION>',
    abi: 'safeMint(toAddress address, tokenUri string)',
      customMintParams: {
        toWalletAddress: "<WALLET_ADDRESS>", 
        tokenUri: "<TOKEN_URI>"
      }
  }
  
  // optional
  const widgetRedirectUris: BackendWidgetRedirectUri = {
    redirectUriOnSuccess: 'https://www.redirectUriOnSuccess.com',
    redirectUriOnFail: 'https://www.redirectUriOnFail.com/',
  }

  const widgetUrl = await backendSDK.nft.buyWithFiat(buyNftPayload, widgetRedirectUris)
  console.log({ widgetUrl })

PreviousFeaturesNextWhitelist

Last updated 10 months ago