How-to for developers · NFTs

Broker an NFT Sale Using Python

In plain words

This tutorial shows how a third account can act as a broker for an NFT sale, using a Python sample app. The broker matches a sell offer with a buy offer and adds an agreed fee. The funds and the ownership of the NFT change hands at the same moment.

Written by zerps in plain words, from the source linked below.
Section
Tutorials

How a brokered sale works

The broker acts on behalf of the NFT owner. The seller creates an offer with the broker account as its destination. The broker gathers and weighs buy offers and chooses which one to accept, adding an agreed fee for arranging the sale. This lets an account act as a marketplace or a personal agent for NFT creators and traders.

What you need

Download the Quickstart Samples archive, then open and run lesson5-broker-nfts.py. The app works with three test accounts: a Broker account, a Standby account and an Operational account. You can load them from seeds you already have or get new ones.

The steps in short

Use the Standby account to create an NFT Sell Offer. Enter the amount in drops, which are millionths of an XRP, the NFT ID and the Broker account as the Destination. Use the Operational account to create an NFT Buy Offer with an amount, the NFT ID and the owner's account. Enter the NFT ID and click Get Offers to list both. Copy the nft_offer_index of the sell offer and of the buy offer into the two offer index fields. Enter a Broker Fee in drops and click Broker Sale. The code defines an accept offer transaction that matches the sell offer with the chosen buy offer.

Good to know

After accepting a buy offer, the page advises the broker to cancel all other offers, if the broker has permission to do so. Click Get Offers for the full list of buy offers, enter the nft_offer_index of the one to cancel and click Cancel Offer.

Source: xrpl.org. Read 6 December 2026.

Zerpedia states what the source says, in plain words, and gives no opinion. How Zerpedia is made

zerps Trading tokens on the XRP Ledger carries risk, including total loss. zerps is a self-custodial interface; it does not hold funds, give advice, or execute trades on your behalf.