Skip to main content

Frequently Asked Questions (FAQ) Operations

Used to display the most frequently asked questions by customers on the Frontend, grouped into categories (Shipping Processes, Returns, Payment Methods, etc.).

The x-avci-client identity header is mandatory for all requests.


1. Get Full FAQ List

Lists the active frequently asked questions in the system, either paginated or filtered by search term.

  • Endpoint: GET /faq
  • Auth Requirement: x-avci-client

Query Parameters

ParameterTypeDescription
pageNumberPage number (Default: 1)
limitNumberNumber of records per page (Default: 10)
searchStringSearches in the question or answer text.

TypeScript Response Schema (Response Interface):

export type FAQ = {
_id: string;
question: string;
answer: string;
date: string; // Date ISO
group: {
_id: string;
title: string;
slug: string;
};
};

2. Get Grouped FAQs

Fetches the frequently asked questions belonging to a specific group (e.g., return-conditions) along with the group details. Often used when rendering Accordion components.

  • Endpoint: GET /faq/:slug
  • Auth Requirement: x-avci-client

Example JSON Response:

{
"status": "success",
"data": {
"title": "Return Conditions",
"slug": "return-conditions",
"description": "General rules regarding your returns.",
"questions": [
{
"question": "How many days is the return period?",
"answer": "Within 14 days from the delivery date..."
}
]
}
}

TypeScript Group Response Schema (Group Response Interface):

export type FAQGroup = {
_id: string;
title: string;
slug?: string;
description: string;
questions: FAQ[]; // FAQ type above
parent?: string;
children?: FAQGroup[];
};