This is a brief workflow of creating BNPL plans.

To use the Cyan's BNPL feature, follow these steps.

  1. Get pricer data
  2. Create BNPL Plan
  3. Make a payment

📘

Info

In order to create a BNPL plan, a user wallet address is required. This is due to the fact Cyan will create a unique signature and return it as a requirement to initiate the BNPL plan via smart contracts. The signature is automatically generated and will return in the response request for BNPL prices.

1. Get pricer data

BNPL pricer accepts a chain slug and an array of NFT collection addresses (address) and Ids (tokenId) as an input and calculates the data for them accordingly. This returns the data required to create a BNPL Plan.

const calculatedData = await cyan.getBnplPrices(
      'mainnet',
      [
        {
          address: "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
          tokenId: "3758",
        },
      ], // NFTs array
      userWalletAddress // User wallet address
    );

📘

When your users initiate a deal on Cyan, they automatically agree to the Terms & Conditions of Cyan. We have an optional signable step you may elect to implement on your front end to make it clear to the user what happens if they miss a payment.

2. Create BNPL Plan

Additionally, to create a BNPL Plan, call the createBnpl method with returned data from the getBnplPrice method.

const desiredNFT = calculatedData[0];

const result = await cyan.createBnpl(desiredNFT); // invokes wallet

3. Make a payment

To make the next payment in a created BNPL Plan, please follow the steps in Plans.