> For the complete documentation index, see [llms.txt](https://docs.startrail.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.startrail.io/issue-transfer-api/collection/create-collection.md).

# Create Collection

<mark style="color:green;">`POST`</mark> `<base_url>/port/api/v1/commerce/collection`

Please replace `<base_url>` as explained [here](/readme/url-per-environment.md).

#### Headers

| Name                                               | Type   | Description                       |
| -------------------------------------------------- | ------ | --------------------------------- |
| commerce-api-key<mark style="color:red;">\*</mark> | string | Commerce API Key                  |
| issuer-address<mark style="color:red;">\*</mark>   | string | Contract Address of API Key owner |

#### Request Body

| Name                                             | Type   | Description                                                                                                                                                                                                                                          |
| ------------------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| payload<mark style="color:red;">\*</mark>        | object | Single object of collection detail that will be created.                                                                                                                                                                                             |
| payload.name<mark style="color:red;">\*</mark>   | string | Name of the collection                                                                                                                                                                                                                               |
| payload.symbol<mark style="color:red;">\*</mark> | string | Collection symbol based on [ERC721Metadata symbol](https://docs.openzeppelin.com/contracts/4.x/api/token/erc721#IERC721Metadata-symbol--).                                                                                                           |
| payload.salt                                     | string | <p>Salt used in Collection creation.</p><p>If provided: it must be a random keccak256 hash like <code>0xea9369d265ddf31c12231b2aeb90662018499cb62117f30cf722bc1b76c62c46</code></p><p>otherwise, if not provided: it will be randomly generated.</p> |

{% tabs %}
{% tab title="201: Created " %}
The API responds with 201 when the collection transaction is sent to the blockchain network.

{% tabs %}
{% tab title="Body" %}

<table><thead><tr><th width="238">Body Attribute</th><th>Description</th><th>Format</th></tr></thead><tbody><tr><td>result</td><td>Single object of collection creation result</td><td>object</td></tr><tr><td>result.name</td><td>The value will be the same as the parameter sent in the request</td><td>string</td></tr><tr><td>result.symbol</td><td>The value will be the same as the parameter sent in the request.</td><td>string</td></tr><tr><td>result.collectionAddress</td><td>collection address that is generated by create2, like <code>0x4412Ba95BEC0CDB4562D97CB9149575Ea5B514A5</code></td><td>string</td></tr><tr><td>result.status</td><td><p>The status of the collection creation transaction.</p><ul><li><code>waiting_for_mining</code> : Mining is in progress.</li><li><code>failed</code>: Collection creation transaction is failed.</li></ul></td><td>string</td></tr></tbody></table>
{% endtab %}

{% tab title="Example" %}

```json
{
  "result": {
    "name": "some nft collection name",
    "symbol": "T22",
    "collectionAddress": "0x4412Ba95BEC0CDB4562D97CB9149575Ea5B514A5",
    "status": "waiting_for_mining"
  }
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="400: Bad Request " %}
The API responds with 400 if the request body is invalid.

```
// If payload is incorrect
{
  "statusCode": 400,
  "message": [
    "payload.name should not be null or undefined"
  ]
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}
The API responds with 500 if there is an issue between the network.

```
// If the network is error or unknown error. Startbahn side need to check.
{
  "statusCode": 502,
  "message": "Bad Gateway"
}
```

{% endtab %}
{% endtabs %}

## Request Body Example

```json
{
  "payload": {
    "name": "some nft collection name",
    "symbol": "T22",
    "salt": "0xea9369d265ddf31c12231b2aeb90662018499cb62117f30cf722bc1b76c62c46"
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.startrail.io/issue-transfer-api/collection/create-collection.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.
