Skip to main content
Place bids on NFTs in a collection whose indexed metadata matches what you specify. A metadata bid can either target a group of tokens that share the same metadata ID (e.g. tokens minted from the same template), or it can match tokens by field-level criteria on the top-level metadata fields (name, image, description, animation_url, external_url, youtube_url) and individual attributes.
See Getting Started for prerequisites and installation.

What is a metadata bid?

  • You offer ERC-20 tokens to buy one or more NFTs from a collection, identified by an ERC-721 collection or ERC-1155 collection buy item.
  • You attach exactly one matching spec:
    • metadataId — a UUID that identifies a group of tokens sharing the same metadata definition in Immutable’s indexer. The bid fills only on tokens whose indexed metadata_id equals this UUID.
    • metadataCriteria — an array of field-level filters. Each filter has a fieldName (a top-level metadata field, or an attribute prefixed with attribute:) and a list of allowed values.
  • Matching semantics for metadataCriteria: every filter you specify must be matched (filters AND). For a given filter, the token matches if its value is one of the allowed values (values OR). Matching is case-insensitive.
  • Matching semantics for metadataId: the token’s indexed metadata_id must equal the supplied UUID exactly.
  • Orders appear as METADATA_BID in API responses alongside listings, bids, collection bids, and trait bids. Use the order type field when branching in your app or webhooks.
If you want to filter purely by individual trait attributes (e.g. Background is Blue) without any top-level metadata fields, a trait bid is a simpler choice. A metadata bid in metadataCriteria mode supports the same attribute filters plus top-level fields.

Prerequisites

  • Same setup as other orderbook flows (Passport or wallet, fees, etc.).
  • Metadata for fulfillment: when a seller fills your bid with a specific tokenId, Immutable validates that token against your matching spec. That requires the NFT’s metadata to be available through Immutable’s indexer. If metadata is missing or out of date, fulfillment can fail even if the token exists on-chain.

Choosing between metadataId and metadataCriteria

Exactly one of the two must be set; supplying both, or neither, is rejected at the SDK and API levels.

Creating a metadata bid

The flow mirrors collection bids: prepare (builds orderComponents, orderHash, and actions) → run any approval transactions → sign the EIP-712 order from the SIGNABLE action → create.
The prepare, approval, and signing steps are identical for both modes. The third step — calling createMetadataBid — is where you pick the matching spec.

Supported fieldName values

In metadataCriteria mode, fieldName must be one of: Each fieldName may appear at most once per bid. The SDK rejects duplicates client-side — combine multiple acceptable values into a single filter’s values array (OR) instead.

Filling a metadata bid (seller)

Sellers call fulfillOrder with the metadata bid order id and the token ID they are selling into the bid. Pass undefined for amountToFill (standard ERC-721 fill) and supply tokenId as a string.
If the token’s indexed metadata does not match the bid’s matching spec — metadata_id mismatch in metadataId mode, or any filter unsatisfied in metadataCriteria mode — the orderbook will not return valid fulfillment data for that token.
For more context on actions, fees, and expiry, see Fill orders.

Querying metadata bids

List metadata bids

Filter by collection contract, status, maker, and pagination.

Get one metadata bid

The response shape is the same for both modes — metadataId is undefined for criteria-mode bids, and metadataCriteria is an empty array for id-mode bids.

Comparison: collection bid vs trait bid vs metadata bid

Fees and cancellation

  • Fees: same maker/taker concepts as other orders — see Fees.
  • Cancel: use the bid’s order id with Cancel orders (soft or hard cancel patterns apply to open orders).

Next steps

Collection bids

Bids on any NFT in a collection without filters

Trait bids

Bids filtered by metadata trait attributes

Fill orders

Fulfillment, actions, and approvals

Cancel orders

Cancel metadata bids you created