> For the complete documentation index, see [llms.txt](https://w3block.gitbook.io/w3block-eng/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://w3block.gitbook.io/w3block-eng/dev-docs/api/commerce-api-services/faq.md).

# Faq

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.

{% 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

### Listing FAQ context items

<details>

<summary>Using SDK</summary>

{% code lineNumbers="true" %}

```typescript
// 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);
```

{% endcode %}

</details>

Rest API reference:

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