Prepare the final song
Load/api/songs/{id} with the creator’s account header. Check that it has final audio, selling terms and artwork. The signer must be the song’s creator. For an original, source must be empty.
Use your own pinning account on your server. For example, this Pinata request pins the final song JSON and returns its CID:
Connect the chain client
UsepublicClient, walletClient, account and evmContracts from Contracts stack. Choose a network from deployed contracts. Payment-network support alone does not establish a Factory deployment.
Mint and verify
mintedId from this receipt using the Factory event example. Read that song and verify its creator, URI and original-song flags before the catalog update below.
Prices in the REST song are decimal amounts. parseUnits converts them to six-decimal atomic units; validate that user-entered prices have at most six decimal places. licenseAmount is the allocation. Read the selected network’s settlement token before showing its currency in your UI.
If confirmation is interrupted, recover the saved hash and receipt. Do not issue another mint because the browser stopped waiting. Wallet rejection, chain failure and catalog-update failure need different recovery actions.
Record and publish
public: false if the mint should stay out of the public catalog. A PATCH only records the result; your integration must verify the chain receipt first.
For Solana, use the Solana integration and record its confirmed song ID and transaction signature. For a variation, use the licensed remix flow.