# Faq (Admin)

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.

<figure><img src="/files/B2RRpWiQsQ4yfBpv8ZY6" alt=""><figcaption><p>Data modelling of FAQ system</p></figcaption></figure>

{% hint style="info" %}
*FAQ items entities are I18n compliant.*
{% endhint %}

<details>

<summary>FAQ Model (Example)</summary>

```json
{
  "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"
}
```

</details>

## Service Methods

### Creates a new FAQ context inside a company

Rest API reference:

{% openapi src="<https://commerce.pixway.io/sdk-json>" path="/admin/companies/{companyId}/faq/contexts" method="post" %}
<https://commerce.pixway.io/sdk-json>
{% endopenapi %}

### Lists all company FAQ contexts

Rest API reference:

{% openapi src="<https://commerce.pixway.io/sdk-json>" path="/admin/companies/{companyId}/faq/contexts" method="get" %}
<https://commerce.pixway.io/sdk-json>
{% endopenapi %}

### Gets some company FAQ context by ID

Rest API reference:

{% openapi src="<https://commerce.pixway.io/sdk-json>" path="/admin/companies/{companyId}/faq/contexts/{contextId}" method="get" %}
<https://commerce.pixway.io/sdk-json>
{% endopenapi %}

### Updates some company FAQ context

Rest API reference:

{% openapi src="<https://commerce.pixway.io/sdk-json>" path="/admin/companies/{companyId}/faq/contexts/{contextId}" method="patch" %}
<https://commerce.pixway.io/sdk-json>
{% endopenapi %}

### Lists all FAQ context items

Rest API reference:

{% openapi src="<https://commerce.pixway.io/sdk-json>" path="/admin/companies/{companyId}/faq/contexts/{contextId}/items" method="get" %}
<https://commerce.pixway.io/sdk-json>
{% endopenapi %}

### Gets some specific FAQ item by ID from some FAQ context

Rest API reference:

{% openapi src="<https://commerce.pixway.io/sdk-json>" path="/admin/companies/{companyId}/faq/contexts/{contextId}/items/{faqItemId}" method="get" %}
<https://commerce.pixway.io/sdk-json>
{% endopenapi %}

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

Rest API reference:

{% openapi src="<https://commerce.pixway.io/sdk-json>" path="/admin/companies/{companyId}/faq/items" method="post" %}
<https://commerce.pixway.io/sdk-json>
{% endopenapi %}

### Lists all FAQ items available in the company independent of context

Rest API reference:

{% openapi src="<https://commerce.pixway.io/sdk-json>" path="/admin/companies/{companyId}/faq/items" method="get" %}
<https://commerce.pixway.io/sdk-json>
{% endopenapi %}

### Gets some FAQ item of company by ID

Rest API reference:

{% openapi src="<https://commerce.pixway.io/sdk-json>" path="/admin/companies/{companyId}/faq/items/{faqItemId}" method="get" %}
<https://commerce.pixway.io/sdk-json>
{% endopenapi %}

### Updates some FAQ item, including re-association of contexts

Rest API reference:

{% openapi src="<https://commerce.pixway.io/sdk-json>" path="/admin/companies/{companyId}/faq/items/{faqItemId}" method="patch" %}
<https://commerce.pixway.io/sdk-json>
{% endopenapi %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://w3block.gitbook.io/w3block-eng/dev-docs/api/commerce-api-services/company-administration/faq-admin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
