Build Transaction

How to interact with the Wayup Marketplace backend

Welcome! This documentation contains hands-on guides and scripts that show how to interact with the Wayup Marketplace backend. You can buy, view, and manage NFTs that are listed for sale almost anywhere on Cardano (JPGStore, Wayup, spacebudz, etc.). You can also list your own NFTs for sale directly on Wayup!


The Power of /build-tx

The heart of the Wayup Marketplace API is the /build-tx endpoint. This single, composable endpoint can construct complex Cardano transactions for virtually any NFT marketplace operation:

  • Buy NFTs from listings

  • List your own NFTs for sale

  • Create offers on specific NFTs

  • Accept offers from buyers (documentation coming soon)

  • Create collection offers on any NFT in a collection (documentation coming soon)

  • Unlist Listings NFTs you previously listed

  • Update Listings listing prices

Multi-Action Transactions

What makes /build-tx truly powerful is its ability to combine multiple actions in a single transaction. For example:

{
  "changeAddress": "addr1...",
  "utxos": ["8282...", "8282..."],
  "buy": [
    { "policyId": "policyId", "txHashIndex": "txHashIndex", "priceAda": 50 }
    { "policyId": "policyId", "txHashIndex": "txHashIndex", "priceAda": 30 }
  ],
  "create": [
    { "policyId": "policyId", "assetName": "assetName", "priceAda": 75 }
  ],
  "createOffer": [
    { "policyId": "policyId", "assetName": "assetName", "priceAda": 25 }
  ]
}

This single call would:

  1. Buy an NFT listing

  2. Buy another NFT listing

  3. List another NFT for sale

  4. Place an offer on a third NFT

All within the same Cardano transaction!

Available Actions

The endpoint accepts these action arrays (all optional):

Action Type
Description

buy

Purchase listed NFTs

create

List NFTs for sale

createOffer

Make offers on specific NFTs

unlist

Remove NFTs from sale

update

Update listing prices

Distribution & Transactions

The response includes both the raw transaction(s) and a distribution map showing which actions are included in each transaction:

{
  "transactions": ["tx_hex_1", "tx_hex_2"],
  "distribution": [
    { "buy": [0], "create": [0, 1] },
    { "createOffer": [0] }
  ]
}

This means:

  • Transaction 1 covers the first buy action and both create actions

  • Transaction 2 handles the offer creation


Documentation Pages

Each documentation page focuses on a specific flow:

Build Transaction

Submit Transaction

Profile Information

Collection Information

Examples

Each documentation page is accompanied by example code demonstrating practical usage of the relevant endpoints. We provide various examples through:

  • Simple code snippets embedded directly in documentation

  • Full standalone example files

Check the specific documentation pages for detailed examples related to each operation.


FAQs

Q: Which network does prod.api.ada-anvil.app target? Mainnet.

Q: Where do I get policy IDs? They're visible in Cardano explorers or in your wallet. See Finding Policy IDs

Q: Can I combine different action types in one transaction? Yes! The /build-tx endpoint is designed for composability. Mix and match actions as needed.

Q: What if my transaction needs multiple signatures? The /submit endpoint accepts an optional signature field. For multi-sig, collect all signatures first.

Last updated

Was this helpful?