> For the complete documentation index, see [llms.txt](https://xact.gitbook.io/xact/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xact.gitbook.io/xact/sdk/javascript/buy-a-nft-qr-code.md).

# Buy a NFT from QR Code

There is another way to buy a NFT. You can also show a QR code on any page ! Once scanned via the Xact Wallet application, the end user will be able to process the payment.&#x20;

## Prerequisites: <a href="#pre-requisites" id="pre-requisites"></a>

{% content-ref url="/pages/-Mi0oowEwFgVkngBRMJ8" %}
[Sell a NFT](/xact/sdk/javascript/sell-a-nft.md)
{% endcontent-ref %}

## Step 1: Import the following modules <a href="#step-1-import-de-following-modules" id="step-1-import-de-following-modules"></a>

Let's continue building on the *index.js* from the previous example ([Environment Set-up](/xact/sdk/javascript/getting-started.md#step-1-set-up-your-node-js-environment)) and add the following modules:

```javascript
const { Client, CategoryNFT } = require("@xact-wallet-sdk/client");
require("dotenv").config();
```

## Step 2: Get your NFT <a href="#step-2-initializing-token-transfer" id="step-2-initializing-token-transfer"></a>

{% hint style="info" %}
Please Note that your NFT need to be on sale.
{% endhint %}

```javascript
const tokenId = '' /* tokenId of the NFT */
const sellerAccountId = '' /* Account ID of the seller */
const nftId = '' /* nftId is Optional for old token */

const res = await client.getNFTForSaleByTokenId({tokenId, sellerAccountId, nftId});

console.log("your NFT", res.nft, "::QRCode", res.qrCode);
```
