Nivapay - Product & API Documentation
  • 📖Introduction
    • 🚀What is Nivapay?
    • 🏂Onboarding Process
  • 💡PRODUCTS
    • Onramp to Merchant Deposit
      • How to integrate
    • NFT Checkout
      • How to integrate
    • NFT Minting
      • How to integrate
    • 💸Currency Coverage
    • ⏯️Test Credentials for Sandbox
    • 📒Registering your Smart Contract
  • 🔗Integrations
    • ☁️Environments
    • 🔑Authentication
    • #️⃣API response codes
    • 📦Web SDK (ReactJS)
  • ⚙️API Documentation
    • Onramp to Merchant Deposit
    • NFT Checkout
    • NFT Minting
  • 🌐Webhooks
    • Overview
    • Onramp to Merchant Deposit
    • NFT Checkout
    • NFT Minting
Powered by GitBook
On this page

Was this helpful?

  1. PRODUCTS
  2. NFT Minting

How to integrate

PreviousNFT MintingNextCurrency Coverage

Last updated 1 year ago

Was this helpful?

Go through the to know about the endpoints to integrate. This page talks about certain request parameters and the values they take.

Generating a new order

Before performing integration, please ensure that you have at least with us. You must have received a smart contract config ID, which you need to pass in the smartContractFunctionId param.

One needs to call the endpoint to generate a new order and redirect the user to the hosted checkout URL to complete the journey. If you are integrating with our , then you don't need to redirect your user. Instead a widget will open on top of your website and the user can engage with it until they complete the journey and close that widget.

Parameters required to execute the smart contract

You need to specify appropriate values for payment.payableCryptoSymbol, payment.payableCryptoContractAddress and network_params.networkName within the contractExecution object corresponding to the smart contract function you intend to call. Permissible values of these params are listed below.

payableCryptoSymbol
payableCryptoContractAddress
NetworkName

ETH

-

Ethereum

BNB

-

Binance Smart Chain

Currently, we do not support smart contracts which receive ERC20 / BEP20 tokens

Nivapay does not have semantic understand of what your smart contract function does. So depending on the function_args, only you would know how much compute intensive it will be and how much funds does it need for successful execution. Therefore, while generating an order please provide accurate values for function_args, payment.totalValue and network_params.customGasLimit because there will be minimal validation from our end.

If network_params.customGasLimit is skipped then we will use the default gas limit provided at the time of smart contract registration.

If the smart contract function does not require any funds to execute (or is not payable) then the entire payment object in the request can be skipped.

Parameters corresponding to payment to be done by the user

Permissible values for crypto_symbol, crypto_network and crypto_contract_address are listed below.

Symbol
Network
contract_address
Description

ETH

Ethereum

-

Ether, the native currency of Ethereum mainnet

BNB

Binance Smart Chain

-

BNB coin, the native currency of BSC mainnet

Currently, we do not support paying in ERC20 / BEP20 tokens

User session validity

The hosted checkout URL when accessed by the user, generates a session for that order. The user can interact with the payment gateway screens to complete the journey during that session. However, once that session is closed or interrupted, it cannot be accessed again due to security reasons. A new order is required to be created to reattempt the transaction. In case the user has already made the payment, then they should wait for at least 2 hours and receive the final status update through email.

Once you specify these params accurately, the endpoint will do the job of back calculating the crypto amount required to successfully execute the entire order. This amount is shared with you in the endpoint's and webhook event. It will also be shown to the user on the order preview (first) page.

If you want to display this fiat amount pre-emptively to the user on your platform, then you can call the endpoint with the same set of params as discussed above. This endpoint returns the crypto_amount and allowed param, which tells that whether this amount is permissible to be paid. If allowed = FALSE, then message contains the detailed reason. This reason can be displayed to your user so that they can take necessary action.

💡
API documentation
registered your testnet smart contract function
Web SDK
order.created
Create Order
Create Order
response
Generate Crypto Quote