Skip to main content
Learn how to fulfill (buy) NFT listings on the Immutable Orderbook. This guide covers filling both ERC-721 and ERC-1155 orders, including partial fills and fee handling.
See Getting Started for prerequisites and installation.

Quick Overview

Fulfilling an order involves these steps:
  1. Call fulfillOrder() - SDK prepares transaction actions and validates fees
  2. Execute approval (if needed) - One-time ERC-20 approval for currency
  3. Execute fulfillment - Submit the buy transaction
  4. Wait for confirmation - Order status transitions to FILLED

Understanding Actions

The fulfillOrder() call returns actions that must be executed in order:
3-Minute Expiration: Transaction data expires 3 minutes after generation. If the user doesn’t submit within this window, you must call fulfillOrder() again to get fresh data with re-validated fees.
Fee Validation: The order object returned contains the most current fees, which may differ from when you queried the listing (e.g., protocol fee reductions during promotions). Always display the fees from this response to users before they sign.

Filling an ERC-721 Order

ERC-721 orders are all-or-nothing—you must purchase the entire NFT.

Basic Example

With Taker Fees

Marketplaces can charge taker fees when facilitating purchases:
Taker Fee Flexibility: Taker fees can be different for each fulfillment. Unlike maker fees (set at listing creation), marketplaces can set custom taker fees per transaction.

Filling collection bids, trait bids, and metadata bids

Collection bids, trait bids, and metadata bids are criteria-style buy orders: the seller (taker) must tell the orderbook which tokenId they are selling into the bid. In the Orderbook SDK, pass tokenId as the fifth argument to fulfillOrder (after orderId, takerAddress, takerFees, and amountToFill). For a typical ERC-721 fill, set amountToFill to undefined and supply tokenId as a string.
  • Collection bid: any token from the collection can be used (subject to order rules). See Collection bids.
  • Trait bid: the same tokenId requirement applies, and the token’s indexed metadata must match every trait filter on the bid. If metadata is missing or does not match, fulfillment will fail—treat as a validation error and choose another asset or refresh metadata. See Trait bids.
  • Metadata bid: the token must satisfy the bid’s matching spec — either its indexed metadata_id equals the bid’s metadataId, or its indexed metadata satisfies every filter in the bid’s metadataCriteria. See Metadata bids.

Filling an ERC-1155 Order (Partial Fills)

ERC-1155 orders support partial fills—buy any quantity up to the available amount.

Full Fill

Buy all available items:

Partial Fill

Buy only some of the available items:

Best-Effort Fulfillment

If you request more items than available, the orderbook attempts a “best-effort” fill:
Best Effort: If amountToFill exceeds available quantity, the orderbook fills up to the maximum available. No error is thrown—you get what’s available.

ERC-1155 Taker Fee Rules

For ERC-1155 orders, taker fees have special rules:
Critical: Taker Fee for Full OrderThe taker fee amount must always reflect the COMPLETE order, even for partial fills. The orderbook automatically pro-rates the fee based on quantity executed.Example:

Complete ERC-1155 Example

Approval Handling

For ERC-20 currency listings, buyers must approve Seaport to spend tokens:
One-Time Approval: Users only need to approve each ERC-20 currency once (or when allowance is insufficient). Subsequent purchases with the same currency skip the approval step.Native Currency: Listings priced in NATIVE (IMX) never require approval—only a fulfillment transaction.For architectural context, see the Approval Pattern documentation.

Fill Status

After fulfillment, check the fill status to see how much has been filled:
Status Transitions: Orders transition from ACTIVEFILLED asynchronously after the transaction confirms. For partial ERC-1155 fills, status remains ACTIVE until completely filled.

Complete Purchase Flow

Full example with error handling and user feedback:

Error Handling

Common errors during fulfillment:

Checking Token Balance

Before fulfilling orders, validate that buyers have sufficient funds: Use ethers.js to check balance:

Best Practices

  1. Show Expiration Timer: Display 3-minute countdown to user
  2. Validate Balance: Check buyer has sufficient funds before calling fulfillOrder() (see above)
  3. Display All Fees: Show protocol fee, royalty, maker fee, taker fee separately
  4. Handle Partial Fills: For ERC-1155, show available quantity and let users choose amount
  5. Optimistic UI: Show “Purchase Pending” immediately, update to “Purchased” after confirmation
  6. Refresh Listings: Poll or use webhooks to detect when orders are filled by others

Next Steps

Create Listings

Learn how to create NFT listings

Order Management

Query order status after purchase

Bulk Operations

Fill multiple orders in one transaction (shopping cart)

Cancel Orders

Cancel listings with soft or hard cancels

Example App

View complete Next.js example on GitHub