Commerce API services

This section explains more about commerce api services and what could be done with it

Commerce services includes all kind of services about sales ecosystem based on NFT tokens. Above we can see the services which commerce is integrated

Commerce service connections/infra architecture

Some examples of what can be done using commerce service:

  • Sell NFTs created using key services

  • Integrate with FIAT payment gateways to receive payments about your token sale

  • Add rules to sell tokens only for specific users or to exclusive users that owns some other collection token

Commerce also have a lightweight front-end that can be easier used by companies to start selling NFT products without any kind of extra development.

Some minor layout customisations can be made into this lightweight front-end inside commerce dashboard.

Glossary

  • Product: is a collection of tokens that can be sold into your commerce service. It can have a set of tokens or just one token. Products can have a unique price or prices by each token.

  • Product Token: is a NFT token that could be sold inside some product collection. All of tokens must be in the same NFT contract address.

  • Currency: Is a currency that can be used to purchase some product. It can be a FIAT or Crypto currency.

  • Order: is the order made to purchase some product token. When some person create an order request, it will lock the NFT token for some minutes (default=10minutes). User will have this time to complete the purchase, i.e, execute the payment, before the order is automatically cancelled.

  • Tag: is a kind of label that can be attached to some product. It can be used to filter products inside the front-end app.

How to instantiate Commerce SDK

To instantiate commerce SDK, you must create the ID SDK before and pass it as argument into the commerce SDK instantiation. Because of this accomplishment, you don't need to worry about the authentication layer using commerce SDK. The ID SDK will do this job for you and send the credentials to each request if you're authenticated - specially if autoRefresh is set as true.

import { W3blockIdSDK } from '@w3block/sdk-id';
import { W3blockCommerceSDK } from '@w3block/sdk-commerce';

const idSdk = new W3blockIdSDK({
    baseURL: 'https://api-id.pixway.io',
    autoRefresh: true,
});

// Authenticate using idSdk with your credentials
// example: idSdk.authenticate({email: ..., password: ..., tenantId: ...})

const sdk = new W3blockCommerceSDK({
    idSdk,
    baseUrl: 'https://commerce.pixway.io'
});

Services available inside commerce API:

Last updated