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.

Product Model (Example)
{
    "id": "434d550e-3502-4afb-9a3f-asd13413sad",
    "createdAt": "2022-10-18T17:01:29.867Z",
    "updatedAt": "2022-10-31T22:11:02.422Z",
    "companyId": "asd13413sad-d3af-40d9-a19e-a263fdfe6e92",
    "name": "Teste",
    "description": "Teste descriΓ§Γ£o",
    "images": [
        {
            "thumb": "http://res.cloudinary.com/tropix-dev/image/upload/v1667254203/commerce/010e92ea-d3af-40d9-a19e-a263fdfe6e92/86db28d6-3bf8-4906-9d2a-fdf792dd74b0.png",
            "assetId": "86db28d6-3bf8-4906-9d2a-fdf792dd74b0",
            "original": "http://res.cloudinary.com/tropix-dev/image/upload/v1667254203/commerce/010e92ea-d3af-40d9-a19e-a263fdfe6e92/86db28d6-3bf8-4906-9d2a-fdf792dd74b0.png"
        }
    ],
    "prices": [
        {
            "amount": "1.50",
            "currencyId": "65fe1119-6ec0-4b78-8d30-cb989914bdcb",
            "currency": {
                "id": "65fe1119-6ec0-4b78-8d30-cb989914bdcb",
                "createdAt": "2022-08-02T19:49:36.166Z",
                "updatedAt": "2022-08-02T19:49:36.166Z",
                "name": "BRL",
                "crypto": false,
                "symbol": "R$",
                "code": "BRL"
            }
        }
    ],
    "distributionType": "random",
    "pricingType": "product",
    "contractAddress": "0x5478a7790e45bb08213b9d7384bf50f65fc0a667",
    "chainId": 80001,
    "startSaleAt": null,
    "endSaleAt": null,
    "status": "published",
    "draftData": {
        "range": "1-5",
        "keyCollectionId": "e3517532-4ebd-4b65-98e4-023888f1ccdd"
    },
    "slug": "teste-shark-qa",
    "stockAmount": 30,
    "tokensAmount": 30,
    "canPurchase": true
}

Service Methods

List the products of company/tenant

Using SDK

Rest API reference:

Gets a product by id

Using SDK

Rest API reference:

Gets a product by slug

Using SDK

Rest API reference:

Check if some product can be purchased

If this method returns canPurchase=true without authentication, that means the product doesn't have any order rule.

Using SDK

Rest API reference:

Last updated