# Primary Purchase Xerial NFT

## Overview

{% hint style="success" %}

### Endpoint

* **Method:** POST
* **URL:** `/wallet/{address}/{chain}/primary-purchase`
  {% endhint %}

### Parameters

* **`address`**: (Path Parameter): Buyer's wallet address (string).
* **`chain`**: (Path Parameter): Blockchain (string).&#x20;

### Request Body

* **Media Type:** application/json
* **Example Value:**

```json
{
  "purchases": {
    "collectionAddress": "0xf6797c479c7b18de2ea7493291d5f21fede8ff29",
    "typeId": 2,
    "quantity": 2
  }
}
```

### Responses

#### Success (Code 200)

```json
{
  "transactionHash": "0xe2e830fcc13af572c0cbe970e69c2ebd873cc85b9984099a072709f1ee62305b"
}
```

* **Media Type**: application/json
* **Example Value**: An object containing the transaction hash for the successful purchase.<br>

## Usage

1. **Send a POST request** to the `/api/wallet/{address}/{chain}/primary-purchase` endpoint to initiate the purchase of one or more Xerial NFTs.
2. **Include the required parameters and request body** in the request.
3. **Handle the response accordingly** based on success, unauthorized access, forbidden access, not found, method not allowed, precondition failed, or internal server error.

**Note:** Ensure the buyer's wallet address and blockchain chain are valid. Verify the user's authentication status and permissions before initiating the purchase.


---

# 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://xerial.gitbook.io/xerial-doc/xerial-apis/wallet-api/transaction-proccessing/primary-purchase-xerial-nft.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.
