> For the complete documentation index, see [llms.txt](https://docs.manifold.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.manifold.xyz/client-sdk/sdk/product/common/purchase.md).

# purchase

**purchase(params)** → [Receipt](/client-sdk/reference/receipt.md)

Initiates a purchase for the specified product.

This method may trigger multiple write transactions (e.g., token approval and minting).

#### Parameters

| Parameter        | Type                                                          | Required | Description                                                                                                                  |
| ---------------- | ------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- |
| account          | [Account](/client-sdk/reference/account.md)                   | ✅        | Buyer’s account                                                                                                              |
| preparedPurchase | [PreparedPurchase](/client-sdk/reference/preparedpurchase.md) | ✅        | Prepared transaction object returned from [preparePurchase](/client-sdk/sdk/product/edition-product/preparepurchase.md) call |
| confirmations    | number                                                        | ❌        | Number of confirmation blocks (Default 1)                                                                                    |

#### Returns: [Receipt](/client-sdk/reference/receipt.md)

The receipt contains the confirmed transaction metadata under `transactionReceipt` and an `order` object with parsed token details for the mint that was executed.

#### Example

```tsx
const receipt = await product.purchase({
  account,
  preparedPurchase,
});

console.log('Mint transaction:', receipt.transactionReceipt.txHash);

if (receipt.order) {
  console.log('Recipient:', receipt.order.recipientAddress);
  for (const item of receipt.order.items) {
    console.log(`Minted token ${item.token.tokenId} x${item.quantity}`);
  }
}
```

[**Errors**](https://www.notion.so/Manifold-Client-SDK-Complete-Developer-Guide-2676b055ee58800abc38ccd30cdfca70?pvs=21)

<table><thead><tr><th width="234.6640625">Code</th><th width="175.30859375">Message</th><th width="142.54296875">data</th><th>metadata</th></tr></thead><tbody><tr><td>TRANSACTION_FAILED</td><td>transaction failed</td><td><a href="https://docs.ethers.org/v5/api/utils/logger/#errors--call-exception">CallExceptions</a></td><td>{ receipts : <a href="/pages/bS5RqVOFBk5bJU9QVdcq">Receipt</a>[]} (For completed steps)</td></tr><tr><td>TRANSACTION_REVERTED</td><td>transaction reverted</td><td><a href="https://docs.ethers.org/v5/api/utils/logger/#errors--call-exception">CallExceptions</a></td><td>{ receipts : <a href="/pages/bS5RqVOFBk5bJU9QVdcq">Receipt</a>[]} (For completed steps)</td></tr><tr><td>TRANSACTION_REJECTED</td><td>user rejected transaction</td><td></td><td>{ receipts : <a href="/pages/bS5RqVOFBk5bJU9QVdcq">Receipt</a>[]} (For completed steps)</td></tr><tr><td>INSUFFIENT_FUNDS</td><td>wallet does not have sufficient funds for purchase</td><td></td><td>{ receipts : <a href="/pages/bS5RqVOFBk5bJU9QVdcq">Receipt</a>[]} (For completed steps)</td></tr><tr><td>LEDGER_ERROR</td><td>error with ledger wallet, make sure blind signing is on</td><td></td><td>{ receipts : <a href="/pages/bS5RqVOFBk5bJU9QVdcq">Receipt</a>[]} (For completed steps)</td></tr></tbody></table>
