W3Block Docs
  • ๐Ÿš€Start here
    • Welcome to the Docs
    • Integrated Blockchains
  • ๐Ÿ‘จโ€๐Ÿ’ปDev Docs
    • API
      • Getting Started
      • Authentication
      • Commerce API services
        • Company Administration
          • Companies (Admin)
          • Assets (Admin)
          • Tags (Admin)
          • Products (Admin)
            • Order Rules (Admin)
          • Orders (Admin)
          • Faq (Admin)
          • Webhooks (Admin)
        • Products
        • Orders
        • Webhooks
        • Faq
        • Globals
      • Key API Services
        • Authentication
        • Companies
        • Tokens
          • Contracts
            • External Contacts
            • Royalty Eligible
          • Categories
            • Subcategories
          • Token Collections
            • Token Editions
          • Metadata
        • Blockchain
        • Cloudinary
        • Integration
          • Ecommerce
            • Associate Tokens
            • Hooks
        • Users
        • Vouchers
  • ๐Ÿ“˜Knowledge Base
    • First Steps
    • FAQ
    • Glossary
Powered by GitBook
On this page
  1. Dev Docs
  2. API
  3. Commerce API services

Faq

PreviousWebhooksNextGlobals

Last updated 2 years ago

You can define a set of questions and answers that is linked to some context, for instance, checkout page. This set of questions inside of some context is our FAQ.

There are some global faqs that exists by default on all of our tenants/companies, but all companies can create its own faq itens inside pre-existing context or event create a completely new context and its own faq items.

FAQ items entities are I18n compliant.

FAQ Model (Example)
{
  "id": "e9aa37cd-0d43-425e-828a-1fda093cbdf1",
  "createdAt": "2022-09-15T14:19:47.052Z",
  "updatedAt": "2022-09-15T14:19:47.052Z",
  "context": {
    "id": "e9aa37cd-0d43-425e-828a-1fda093cbdf2",
    "createdAt": "2022-09-15T14:19:47.052Z",
    "updatedAt": "2022-09-15T14:19:47.052Z",
    "name": "pre-sale"
  }
  "question": {
    "pt-br": "Como comprar?",
    "en": "How to purchase?"
  },
  "answer": {
    "pt-br": "Basta colocar o cartao de credito e pagar que adicionamos a sua wallet.",
    "en": "You can put your items into your cart, click on purchase and pay with your credit card."
  },
  "externalUrl": "https://w3block.io/faqitem"
}

Service Methods

Listing FAQ context items

Using SDK
// init your sdk as defined in main page of Commerce service
import { W3blockCommerceSDK } from '@w3block/sdk-commerce';
const sdk: W3blockCommerceSDK;
...

const tenantId = '<your tenant id>';
const faqItems = await sdk.api.companies.listFaq(tenantId, { page: 1, limit: 10, name: 'pre-sale' });
console.log('faqItems', faqItems);

Rest API reference:

๐Ÿ‘จโ€๐Ÿ’ป
get

Lists FAQ items (questions/answers) inside a context by name including global faq contexts and specific company faq context items

Authorizations
Path parameters
companyIdstringRequired
Query parameters
pagenumberOptionalDefault: 1
limitnumberOptionalDefault: 10
searchstringOptional
sortBystringOptional
orderBystring ยท enumOptionalPossible values:
contextIdstring ยท uuidOptional
namestringOptionalExample: pre_sale
Responses
200Success
application/json
get
GET /companies/{companyId}/faq HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
200Success
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "createdAt": "2025-06-01T16:09:15.520Z",
      "updatedAt": "2025-06-01T16:09:15.520Z",
      "question": {
        "pt-br": "Algum texto em pt-br",
        "en": "Some text in en"
      },
      "answer": {
        "pt-br": "Algum texto em pt-br",
        "en": "Some text in en"
      },
      "externalUrl": "https://myquestion.should.move.to/"
    }
  ],
  "meta": {
    "itemCount": 1,
    "totalItems": 1,
    "itemsPerPage": 1,
    "totalPages": 1,
    "currentPage": 1
  },
  "links": {
    "first": "http://example.com?page=1",
    "prev": "http://example.com?page=1",
    "next": "http://example.com?page=2",
    "last": "http://example.com?page=3"
  }
}
  • Service Methods
  • Listing FAQ context items
  • GET/companies/{companyId}/faq