Create a collection
Issue a POST
request to the collections
endpoint to create a collection. The collections
endpoint takes an optional deployment_request
if you want to create and deploy the collection within one request.
POST https://admin-api.phosphor.xyz/v1/collections
The following is an example payload and a description of the parameters.
Example payload
{
"name": "Collection ABC",
"default_item_type_id": null,
"image_url": null,
"reveal_strategy": "INSTANT",
"preview_metadata": null,
"editable_metadata": false,
"deployment_request": {
"type": "PLATFORM",
"token_id_assignment_strategy": "AUTOMATIC",
"platform": {
"symbol": "ABC",
"variant": "FlexibleERC721"
},
"network_id": 59140
}
}
Parameter | Required? | Description |
---|---|---|
name | Yes | The name of the collection. Should be unique in your organization. |
default_item_type_id | No | ID of the item type commonly associated with this collection. |
image_url | No | URL of an image to be used as a cover image for the collection. |
reveal_strategy | No | Reveal style for items. Whether items' metadata will be revealed instantly after mint or delayed for reveal. Accepted values are INSTANT or DELAYED . Default to INSTANT . |
preview_metadata | No | Collection preview metadata shown on all items prior to triggering the reveal. Required when reveal_strategy =DELAYED |
editable_metadata | No | Whether items' metadata are allowed to change after minted. Default to false . |
deployment_request | No | Whether to deploy the collection contract at the time of creating the collection. See more details in configuring contracts. |
Example response
{
"default_item_type_id": null,
"deployment": {
"address": null,
"capabilities": [],
"network_id": null,
"symbol": "ABC",
"token_id_assignment_strategy": "AUTOMATIC",
"token_type": "ERC721",
"transaction_id": "a2556a16-bd64-4afd-bdbc-e8354d27169f"
},
"functions_enabled": false,
"id": "cba8a297-0f8b-43ee-8481-83669393d874",
"image_url": null,
"name": "Collection ABC",
"royalty_info": null,
"reveal_strategy": "INSTANT",
"preview_metadata": null,
"reveal_hidden": false,
"editable_metadata": false
}
Note the following in the response:
- If the
address
andcapabilities
properties don't have a value, there's still a pending transaction (transaction_id
) awaiting execution. This means the smart contract is waiting to be deployed. royalty_info
has no default setting for the contract. This can be modified through editing a collection.functions_enabled
is set tofalse
by default; there can be no manual interaction with the contract through API calls. This can be modified through editing a collection.reveal_hidden
isfalse
by default for all collections with anINSTANT
reveal strategy. For collections withDELAYED
reveal, it istrue
by default, and can be manually set tofalse
to enable metadata reveal through editing a collection. Oncefalse
, it cannot be set totrue
again.preview_metadata
isnull
for Instant reveal strategy. For Delayed reveal strategy,preview_metadata
is contents of the original payload forpreview_metadata
.editable_metadata
isfalse
by default for all collections, unless it is set to betrue
in the original payload. It can be disabled through editing a collection. Oncefalse
, it cannot be set totrue
again.