Products
Products are basically a kind of "wrapper" around a NFT collection. It can have a set of tokens also known as stocks to be sold grouped in the product. Some characteristics of products:
Products can have prices by currency, which means that it can be sold in multiple payment gateways, depending on the currency that should be used in the order creation
Products can have a distribution type which is used to select the tokens to be delivered if the token inside the product is not specifically defined in the order purchase creation. The distribution types can be:
random: It selects some available token randomly
sequential: It selects the next available token by tokenId
fixed: You can define for each one product token which user can purchase the token and this kind of match distribute based on that rules.
Products can have a pricing type which defines if the price will be applied for all tokens inside the product or if the price is defined by each token. Available price types:
product: Its defined by product (one for all tokens)
token: Each token must define a price
Products can have custom images, name and description instead of just using the blockchain information.
Service Methods
List the products of company/tenant
Rest API reference:
1
10
createdAt
Possible 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)
false
Example: false
GET /companies/{companyId}/products HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
No content
Gets a product by id
Rest API reference:
Forces permission refresh which can affect canPurchase result params
false
Example: false
GET /companies/{companyId}/products/{productId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
No content
Gets a product by slug
Rest API reference:
Forces permission refresh which can affect canPurchase result params
false
Example: false
GET /companies/{companyId}/products/get-by-slug/{slug} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
No content
Check if some product can be purchased
Rest API reference:
GET /companies/{companyId}/products/{productId}/can-purchase HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
No content
Last updated