Products (Admin)
Products are one of the main entities of commerce system. They are the entity which describes exactly what are the collection and tokens that are being sold in your e-commerce.
You can create products that represents one entire collection or even represents one unique and specific token from your collection/contract. If you have one product that contains more than one token, you can also specify different prices depending on the token that you want to sell. See more in Public Products Page.
Service Methods
Creates a product inside the company
Rest API reference:
Enter JWT token
W3Block ProductMy DescriptionrandomPossible values: productPossible values: <b>block</b>trueExample: true0Example: 0User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
POST /admin/companies/{companyId}/products HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 1060
{
"tags": [
"7ca74ed3-93ff-4df9-b8a0-8308c590174b"
],
"name": "W3Block Product",
"description": "My Description",
"images": [
{
"assetId": "123e4567-e89b-12d3-a456-426614174000",
"variants": [
{
"keyLabel": "text",
"keyValue": "text"
}
]
}
],
"prices": [
{
"currencyId": "65fe1119-6ec0-4b78-8d30-cb989914bdcb",
"amount": "0.01"
}
],
"distributionType": "random",
"pricingType": "product",
"startSaleAt": null,
"endSaleAt": null,
"draftData": {
"keyCollectionId": null,
"range": null
},
"slug": "text",
"htmlContent": "<b>block</b>",
"onDemandMintEnabled": true,
"requirements": {
"companyId": "123e4567-e89b-12d3-a456-426614174000",
"keyCollectionId": "123e4567-e89b-12d3-a456-426614174000",
"productId": "123e4567-e89b-12d3-a456-426614174000",
"requirementCTALabel": "text",
"requirementDescription": "text",
"requirementModalContent": "text",
"requireKycContext": {
"slug": "text"
}
},
"terms": null,
"relevance": 0,
"settings": {
"passShareCodeConfig": {
"dataFields": [
{
"name": "text",
"type": "text",
"label": "text",
"required": true
}
],
"enabled": true
},
"acceptMultipleCurrenciesPurchase": true,
"minCartItemPrice": "100",
"disableImageDisplay": true
}
}{}Lists all product of some company
Rest API reference:
Enter JWT token
110createdAtPossible values: Includes first product token found metadata for each product. (Works good if you want to get some common NFT metadata attributes that is applied for all contract tokens)
falseExample: falseUser doesn't have any of the expected roles: administrator, admin, superAdmin, integration
GET /admin/companies/{companyId}/products HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Gets a company product by slug
Rest API reference:
Enter JWT token
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
GET /admin/companies/{companyId}/products/get-by-slug/{slug} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Gets a company product by id
Rest API reference:
Enter JWT token
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
GET /admin/companies/{companyId}/products/{productId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Updates some company product
You can't update tokens amount or collection from published product tokens. In a near future we are planning to offer that, but for a while, you will need to create a new one.
Rest API reference:
Enter JWT token
W3Block ProductMy DescriptionrandomPossible values: productPossible values: <b>block</b>trueExample: true0Example: 0User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
PATCH /admin/companies/{companyId}/products/{productId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 1060
{
"tags": [
"7ca74ed3-93ff-4df9-b8a0-8308c590174b"
],
"name": "W3Block Product",
"description": "My Description",
"images": [
{
"assetId": "123e4567-e89b-12d3-a456-426614174000",
"variants": [
{
"keyLabel": "text",
"keyValue": "text"
}
]
}
],
"prices": [
{
"currencyId": "65fe1119-6ec0-4b78-8d30-cb989914bdcb",
"amount": "0.01"
}
],
"distributionType": "random",
"pricingType": "product",
"startSaleAt": null,
"endSaleAt": null,
"draftData": {
"keyCollectionId": null,
"range": null
},
"slug": "text",
"htmlContent": "<b>block</b>",
"onDemandMintEnabled": true,
"requirements": {
"companyId": "123e4567-e89b-12d3-a456-426614174000",
"keyCollectionId": "123e4567-e89b-12d3-a456-426614174000",
"productId": "123e4567-e89b-12d3-a456-426614174000",
"requirementCTALabel": "text",
"requirementDescription": "text",
"requirementModalContent": "text",
"requireKycContext": {
"slug": "text"
}
},
"terms": null,
"relevance": 0,
"settings": {
"passShareCodeConfig": {
"dataFields": [
{
"name": "text",
"type": "text",
"label": "text",
"required": true
}
],
"enabled": true
},
"acceptMultipleCurrenciesPurchase": true,
"minCartItemPrice": "100",
"disableImageDisplay": true
}
}No content
Publish a company product
Only published products can be purchased because is this endpoint that gets the permission of transfer and all other things about blockchain tokens informations.
Rest API reference:
Enter JWT token
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
PATCH /admin/companies/{companyId}/products/{productId}/publish HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Last updated