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
  4. Company Administration

Faq (Admin)

PreviousOrders (Admin)NextWebhooks (Admin)

Last updated 2 years ago

Companies can create some FAQ context and maintain its FAQ items. This module makes possible to manipulate that entities.

A FAQ item can be associated to one or more contexts and it is technically independent of a context. You can see the model representation bellow.

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

Creates a new FAQ context inside a company

Rest API reference:

Lists all company FAQ contexts

Rest API reference:

Gets some company FAQ context by ID

Rest API reference:

Updates some company FAQ context

Rest API reference:

Lists all FAQ context items

Rest API reference:

Gets some specific FAQ item by ID from some FAQ context

Rest API reference:

Creates a FAQ item and associate it to one or more contexts

Rest API reference:

Lists all FAQ items available in the company independent of context

Rest API reference:

Gets some FAQ item of company by ID

Rest API reference:

Updates some FAQ item, including re-association of contexts

Rest API reference:

👨‍💻
get

Lists all company FAQ contexts

Authorizations
Path parameters
companyIdstringRequired
Query parameters
pagenumberOptionalDefault: 1
limitnumberOptionalDefault: 10
searchstringOptional
sortBystringOptional
orderBystring · enumOptionalPossible values:
Responses
200Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
get
GET /admin/companies/{companyId}/faq/contexts HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "createdAt": "2025-06-01T14:49:26.295Z",
      "updatedAt": "2025-06-01T14:49:26.295Z",
      "companyId": "123e4567-e89b-12d3-a456-426614174000",
      "company": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "createdAt": "2025-06-01T14:49:26.295Z",
        "updatedAt": "2025-06-01T14:49:26.295Z",
        "name": "text"
      },
      "name": "pre_sale"
    }
  ],
  "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"
  }
}
get

Gets a company FAQ context

Authorizations
Path parameters
companyIdstringRequired
contextIdstringRequired
Responses
200Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
get
GET /admin/companies/{companyId}/faq/contexts/{contextId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-06-01T14:49:26.295Z",
  "updatedAt": "2025-06-01T14:49:26.295Z",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "company": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-06-01T14:49:26.295Z",
    "updatedAt": "2025-06-01T14:49:26.295Z",
    "name": "text"
  },
  "name": "pre_sale"
}
get

Lists all FAQ items inside some company context

Authorizations
Path parameters
companyIdstringRequired
contextIdstringRequired
Query parameters
pagenumberOptionalDefault: 1
limitnumberOptionalDefault: 10
searchstringOptional
sortBystringOptional
orderBystring · enumOptionalPossible values:
Responses
200Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
get
GET /admin/companies/{companyId}/faq/contexts/{contextId}/items HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "createdAt": "2025-06-01T14:49:26.295Z",
      "updatedAt": "2025-06-01T14:49:26.295Z",
      "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"
  }
}
get

Gets company context FAQ item by id

Authorizations
Path parameters
companyIdstringRequired
contextIdstringRequired
faqItemIdstringRequired
Responses
200Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
get
GET /admin/companies/{companyId}/faq/contexts/{contextId}/items/{faqItemId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-06-01T14:49:26.295Z",
  "updatedAt": "2025-06-01T14:49:26.295Z",
  "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/"
}
get

Lists all company FAQ items which are associated to some company context

Authorizations
Path parameters
companyIdstringRequired
Query parameters
pagenumberOptionalDefault: 1
limitnumberOptionalDefault: 10
searchstringOptional
sortBystringOptional
orderBystring · enumOptionalPossible values:
Responses
200Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
get
GET /admin/companies/{companyId}/faq/items HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "createdAt": "2025-06-01T14:49:26.295Z",
      "updatedAt": "2025-06-01T14:49:26.295Z",
      "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"
  }
}
get

Gets a company FAQ item by id

Authorizations
Path parameters
companyIdstringRequired
faqItemIdstringRequired
Responses
200Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
get
GET /admin/companies/{companyId}/faq/items/{faqItemId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-06-01T14:49:26.295Z",
  "updatedAt": "2025-06-01T14:49:26.295Z",
  "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/"
}
  • Service Methods
  • Creates a new FAQ context inside a company
  • POST/admin/companies/{companyId}/faq/contexts
  • Lists all company FAQ contexts
  • GET/admin/companies/{companyId}/faq/contexts
  • Gets some company FAQ context by ID
  • GET/admin/companies/{companyId}/faq/contexts/{contextId}
  • Updates some company FAQ context
  • PATCH/admin/companies/{companyId}/faq/contexts/{contextId}
  • Lists all FAQ context items
  • GET/admin/companies/{companyId}/faq/contexts/{contextId}/items
  • Gets some specific FAQ item by ID from some FAQ context
  • GET/admin/companies/{companyId}/faq/contexts/{contextId}/items/{faqItemId}
  • Creates a FAQ item and associate it to one or more contexts
  • POST/admin/companies/{companyId}/faq/items
  • Lists all FAQ items available in the company independent of context
  • GET/admin/companies/{companyId}/faq/items
  • Gets some FAQ item of company by ID
  • GET/admin/companies/{companyId}/faq/items/{faqItemId}
  • Updates some FAQ item, including re-association of contexts
  • PATCH/admin/companies/{companyId}/faq/items/{faqItemId}
post

Creates a new FAQ context for a company

Authorizations
Path parameters
companyIdstringRequired
Body
namestringRequiredExample: pre_sale
Responses
201Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
post
POST /admin/companies/{companyId}/faq/contexts HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "name": "pre_sale"
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-06-01T14:49:26.295Z",
  "updatedAt": "2025-06-01T14:49:26.295Z",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "company": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-06-01T14:49:26.295Z",
    "updatedAt": "2025-06-01T14:49:26.295Z",
    "name": "text"
  },
  "name": "pre_sale"
}
patch

Updates some company FAQ context

Authorizations
Path parameters
companyIdstringRequired
contextIdstringRequired
Body
namestringRequiredExample: pre_sale
Responses
200Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
patch
PATCH /admin/companies/{companyId}/faq/contexts/{contextId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "name": "pre_sale"
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-06-01T14:49:26.295Z",
  "updatedAt": "2025-06-01T14:49:26.295Z",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "company": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdAt": "2025-06-01T14:49:26.295Z",
    "updatedAt": "2025-06-01T14:49:26.295Z",
    "name": "text"
  },
  "name": "pre_sale"
}
post

Creates a new FAQ item inside one or more company contexts

Authorizations
Path parameters
companyIdstringRequired
Body
externalUrlstringOptionalExample: https://myquestion.should.move.to/
Responses
201Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
post
POST /admin/companies/{companyId}/faq/items HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 257

{
  "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/",
  "contexts": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "relevance": 0
    }
  ]
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-06-01T14:49:26.295Z",
  "updatedAt": "2025-06-01T14:49:26.295Z",
  "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/"
}
patch

Updates some FAQ item and associate/disassociate it contexts

Authorizations
Path parameters
companyIdstringRequired
faqItemIdstringRequired
Body
externalUrlstringOptionalExample: https://myquestion.should.move.to/
Responses
200Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
patch
PATCH /admin/companies/{companyId}/faq/items/{faqItemId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 257

{
  "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/",
  "contexts": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "relevance": 0
    }
  ]
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-06-01T14:49:26.295Z",
  "updatedAt": "2025-06-01T14:49:26.295Z",
  "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/"
}
Data modelling of FAQ system