# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.manifold.xyz/client-sdk/sdk/product/common/purchase.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
